hwmon: (gpio_fan) Use error value returned from get_fan_speed_index()
Guenter Roeck
maintainerPATCH 7/12 hwmon: (gpio_fan) Use error value returned from get_fan_speed_index()
get_fan_speed_index() returns -EINVAL in case of errors, only to have it ignored and replaced with -ENODEV. Make it return -ENODEV and use it.
Signed-off-by Guenter Roeck <[email protected]>
--- drivers/hwmon/gpio-fan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwmon/gpio-fan.c +2 -2
@@ -169,7 +169,7 @@ static int get_fan_speed_index(struct gpio_fan_data *fan_data)dev_warn (&fan_data->pdev->dev,"missing speed array entry for GPIO value 0x%x\n" , ctrl_val); -return -EINVAL ; +return -ENODEV ; }static int rpm_to_speed_index (struct gpio_fan_data *fan_data,int rpm)
@@ -384,7 +384,7 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data, fan_data->pwm_enable = true;/* Enable manual fan speed control. */ fan_data->speed_index =get_fan_speed_index (fan_data);if (fan_data->speed_index <0 ) -return -ENODEV ; +return fan_data->speed_index;return 0 ; }
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors