Skip to content

Commit b92b298

Browse files
Su Huigroeck
authored andcommitted
hwmon: (npcm750-pwm) Add an error code check in npcm7xx_en_pwm_fan
npcm7xx_pwm_config_set() can return '-ENODEV' for failed. So check the value of 'ret' after calling npcm7xx_pwm_config_set(). Signed-off-by: Su Hui <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 748465a commit b92b298

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/hwmon/npcm750-pwm-fan.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,8 @@ static int npcm7xx_en_pwm_fan(struct device *dev,
875875
data->pwm_present[pwm_port] = true;
876876
ret = npcm7xx_pwm_config_set(data, pwm_port,
877877
NPCM7XX_PWM_CMR_DEFAULT_NUM);
878+
if (ret)
879+
return ret;
878880

879881
ret = of_property_count_u8_elems(child, "cooling-levels");
880882
if (ret > 0) {

0 commit comments

Comments
 (0)