From: Guenter Roeck Date: Fri, 27 Mar 2015 13:03:41 +0000 (-0700) Subject: hwmon: (it87) Fix pwm sysfs attribute removal X-Git-Tag: v4.1-rc1~167^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1696d1deb05710f246f62e810034fb5d8d7713bd;p=platform%2Fkernel%2Flinux-exynos.git hwmon: (it87) Fix pwm sysfs attribute removal Detection if a pwm channel is supported was wrong on removal, causing the code to try removing non-existing sysfs attributes. That didn't matter much because sysfs attribute removal of non-existing files fails silently, and because the wrong evaluation always returned false, but should nevertheless be fixed. Reviewed-by: Jean Delvare Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index ab12dc2..81a43db 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -2079,7 +2079,7 @@ static void it87_remove_files(struct device *dev) it87_attributes_fan_div[i]); } for (i = 0; i < 3; i++) { - if (sio_data->skip_pwm & (1 << 0)) + if (sio_data->skip_pwm & (1 << i)) continue; sysfs_remove_group(&dev->kobj, &it87_group_pwm[i]); if (has_old_autopwm(data))