mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
pwm: dwc-core: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this driver in the same commit as struct pwm_chip::dev, use the accessor function provided for exactly this purpose. Link: https://lore.kernel.org/r/5240ba82ac227e3723678041bd69b9c7a9e3db43.1707900770.git.u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This commit is contained in:
parent
1647e5065b
commit
4839f5a7c4
@ -105,12 +105,12 @@ static int dwc_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||
|
||||
if (state->enabled) {
|
||||
if (!pwm->state.enabled)
|
||||
pm_runtime_get_sync(chip->dev);
|
||||
pm_runtime_get_sync(pwmchip_parent(chip));
|
||||
return __dwc_pwm_configure_timer(dwc, pwm, state);
|
||||
} else {
|
||||
if (pwm->state.enabled) {
|
||||
__dwc_pwm_set_enable(dwc, pwm->hwpwm, false);
|
||||
pm_runtime_put_sync(chip->dev);
|
||||
pm_runtime_put_sync(pwmchip_parent(chip));
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ static int dwc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||
u64 duty, period;
|
||||
u32 ctrl, ld, ld2;
|
||||
|
||||
pm_runtime_get_sync(chip->dev);
|
||||
pm_runtime_get_sync(pwmchip_parent(chip));
|
||||
|
||||
ctrl = dwc_pwm_readl(dwc, DWC_TIM_CTRL(pwm->hwpwm));
|
||||
ld = dwc_pwm_readl(dwc, DWC_TIM_LD_CNT(pwm->hwpwm));
|
||||
@ -149,7 +149,7 @@ static int dwc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||
state->period = period;
|
||||
state->duty_cycle = duty;
|
||||
|
||||
pm_runtime_put_sync(chip->dev);
|
||||
pm_runtime_put_sync(pwmchip_parent(chip));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user