Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: atmel-hlcdc: Don't use pwm consumer API

Lowlevel driver callbacks are not supposed to use the consumer API
functions. Currently this works, but with the upcoming locking changes
this probably results in dead locks.

Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Link: https://lore.kernel.org/r/6e34607828b290cd64ca9f82df40872853069f07.1706269232.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

+5 -7
+5 -7
drivers/pwm/pwm-atmel-hlcdc.c
··· 183 183 static int atmel_hlcdc_pwm_suspend(struct device *dev) 184 184 { 185 185 struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev); 186 + struct pwm_device *pwm = &atmel->chip.pwms[0]; 186 187 187 188 /* Keep the periph clock enabled if the PWM is still running. */ 188 - if (!pwm_is_enabled(&atmel->chip.pwms[0])) 189 + if (!pwm->state.enabled) 189 190 clk_disable_unprepare(atmel->hlcdc->periph_clk); 190 191 191 192 return 0; ··· 195 194 static int atmel_hlcdc_pwm_resume(struct device *dev) 196 195 { 197 196 struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev); 198 - struct pwm_state state; 197 + struct pwm_device *pwm = &atmel->chip.pwms[0]; 199 198 int ret; 200 199 201 - pwm_get_state(&atmel->chip.pwms[0], &state); 202 - 203 200 /* Re-enable the periph clock it was stopped during suspend. */ 204 - if (!state.enabled) { 201 + if (!pwm->state.enabled) { 205 202 ret = clk_prepare_enable(atmel->hlcdc->periph_clk); 206 203 if (ret) 207 204 return ret; 208 205 } 209 206 210 - return atmel_hlcdc_pwm_apply(&atmel->chip, &atmel->chip.pwms[0], 211 - &state); 207 + return atmel_hlcdc_pwm_apply(&atmel->chip, pwm, &pwm->state); 212 208 } 213 209 214 210 static DEFINE_SIMPLE_DEV_PM_OPS(atmel_hlcdc_pwm_pm_ops,