diff options
author | Guenter Roeck <linux@roeck-us.net> | 2013-09-13 13:42:39 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-10-13 19:16:26 -0400 |
commit | c52ae3d2794ee2a248245a9e5a26f717e1c401f5 (patch) | |
tree | 927fbc67c2d81ed2b1154798d12af4e9366cf8c3 /drivers/hwmon/gpio-fan.c | |
parent | bb34c0da646530425d9ae0e6e6229e641469da4c (diff) |
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 <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/gpio-fan.c')
-rw-r--r-- | drivers/hwmon/gpio-fan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index b7d6a5704eb2..155c78f09d88 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c | |||
@@ -169,7 +169,7 @@ static int get_fan_speed_index(struct gpio_fan_data *fan_data) | |||
169 | dev_warn(&fan_data->pdev->dev, | 169 | dev_warn(&fan_data->pdev->dev, |
170 | "missing speed array entry for GPIO value 0x%x\n", ctrl_val); | 170 | "missing speed array entry for GPIO value 0x%x\n", ctrl_val); |
171 | 171 | ||
172 | return -EINVAL; | 172 | return -ENODEV; |
173 | } | 173 | } |
174 | 174 | ||
175 | static int rpm_to_speed_index(struct gpio_fan_data *fan_data, int rpm) | 175 | 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, | |||
384 | fan_data->pwm_enable = true; /* Enable manual fan speed control. */ | 384 | fan_data->pwm_enable = true; /* Enable manual fan speed control. */ |
385 | fan_data->speed_index = get_fan_speed_index(fan_data); | 385 | fan_data->speed_index = get_fan_speed_index(fan_data); |
386 | if (fan_data->speed_index < 0) | 386 | if (fan_data->speed_index < 0) |
387 | return -ENODEV; | 387 | return fan_data->speed_index; |
388 | 388 | ||
389 | return 0; | 389 | return 0; |
390 | } | 390 | } |