hwmon: (pwm-fan) split __set_pwm into locked/unlocked functions
authorAlexander Stein <alexander.stein@ew.tq-group.com>
Wed, 14 Sep 2022 15:31:36 +0000 (17:31 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 25 Sep 2022 21:22:11 +0000 (14:22 -0700)
commit9db6e7f500541b797acc207c790024f6179e2e6c
tree910bdab3f3451819116b169155fb805176949c1b
parent9bf3aa60808803d56cb34bdff336e85c87c8026d
hwmon: (pwm-fan) split __set_pwm into locked/unlocked functions

Regular calls to set_pwm don't hold the mutex, but the upcoming
update_enable support needs to call set_pwm with the mutex being held.
So provide the previous behavior in set_pwm (handling the lock), while
adding __set_pwm which assumes the lock being held.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220914153137.613982-5-alexander.stein@ew.tq-group.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pwm-fan.c