Skip to content
Commit 86585c61 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Guenter Roeck
Browse files

hwmon: (pwm-fan) stop using legacy PWM functions and some cleanups



pwm_apply_state() does what the legacy functions pwm_config() and
pwm_{en,dis}able() do in a single function call. This simplifies error
handling and is more efficient for new-style PWM hardware drivers.

Instead of repeatedly querying the PWM framework about the initial PWM
configuration, cache the settings in driver data.

Also use __set_pwm() in .probe() to have the algorithm calculating the PWM
state in a single place.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210112191314.124686-1-u.kleine-koenig@pengutronix.de


[groeck: Added missing empty line after declaration]
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 8c78f0de
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment