From: Guenter Roeck Date: Fri, 13 Sep 2013 17:42:39 +0000 (-0700) Subject: hwmon: (gpio_fan) Use error value returned from get_fan_speed_index() X-Git-Tag: accepted/tizen/common/20141203.182822~1162^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c52ae3d2794ee2a248245a9e5a26f717e1c401f5;p=platform%2Fkernel%2Flinux-arm64.git 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 --- diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index b7d6a57..155c78f 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) 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; }