diff options
Diffstat (limited to 'drivers/hwmon/gpio-fan.c')
-rw-r--r-- | drivers/hwmon/gpio-fan.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index 82de3deeb18a..685568b1236d 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c | |||
@@ -406,16 +406,11 @@ static int gpio_fan_get_cur_state(struct thermal_cooling_device *cdev, | |||
406 | unsigned long *state) | 406 | unsigned long *state) |
407 | { | 407 | { |
408 | struct gpio_fan_data *fan_data = cdev->devdata; | 408 | struct gpio_fan_data *fan_data = cdev->devdata; |
409 | int r; | ||
410 | 409 | ||
411 | if (!fan_data) | 410 | if (!fan_data) |
412 | return -EINVAL; | 411 | return -EINVAL; |
413 | 412 | ||
414 | r = get_fan_speed_index(fan_data); | 413 | *state = fan_data->speed_index; |
415 | if (r < 0) | ||
416 | return r; | ||
417 | |||
418 | *state = r; | ||
419 | return 0; | 414 | return 0; |
420 | } | 415 | } |
421 | 416 | ||