hwmon: npcm750-pwm: add an error code check in npcm7xx_en_pwm_fan
Subsystems (4)
PATCH 1/1 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]>
--- drivers/hwmon/npcm750-pwm-fan.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hwmon/npcm750-pwm-fan.c +2 -0
@@ -875,6 +875,8 @@ static int npcm7xx_en_pwm_fan(struct device *dev, data->pwm_present[pwm_port] = true; ret =npcm7xx_pwm_config_set (data, pwm_port,NPCM7XX_PWM_CMR_DEFAULT_NUM ); +if (ret) +return ret; ret =of_property_count_u8_elems (child,"cooling-levels" );if (ret >0 ) {
Signature · 1 line
2.30.2
Quoted 4 lines · Su Hui
npcm7xx_pwm_config_set()can return '-ENODEV' for failed. So check the value of 'ret' after callingnpcm7xx_pwm_config_set().Signed-off-by Su Hui <[email protected]>
Applied.
Thanks,
Guenter