Commit d6ada1d4 authored by Uwe Kleine-König's avatar Uwe Kleine-König

pwm: sun4i: 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.
Reviewed-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/3ddaec73f3abefb45625d0a469026fa8d13da8c0.1707900770.git.u.kleine-koenig@pengutronix.deSigned-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent f20fb5c8
...@@ -245,7 +245,7 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, ...@@ -245,7 +245,7 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
if (!cstate.enabled) { if (!cstate.enabled) {
ret = clk_prepare_enable(sun4i_pwm->clk); ret = clk_prepare_enable(sun4i_pwm->clk);
if (ret) { if (ret) {
dev_err(chip->dev, "failed to enable PWM clock\n"); dev_err(pwmchip_parent(chip), "failed to enable PWM clock\n");
return ret; return ret;
} }
} }
...@@ -253,7 +253,7 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, ...@@ -253,7 +253,7 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
ret = sun4i_pwm_calculate(sun4i_pwm, state, &duty, &period, &prescaler, ret = sun4i_pwm_calculate(sun4i_pwm, state, &duty, &period, &prescaler,
&bypass); &bypass);
if (ret) { if (ret) {
dev_err(chip->dev, "period exceeds the maximum value\n"); dev_err(pwmchip_parent(chip), "period exceeds the maximum value\n");
if (!cstate.enabled) if (!cstate.enabled)
clk_disable_unprepare(sun4i_pwm->clk); clk_disable_unprepare(sun4i_pwm->clk);
return ret; return ret;
......
Markdown is supported
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