pwm: fsl-ftm: 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/131f976a8f876a88e2a940f5acf6aa1d81833b89.1707900770.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This commit is contained in:
Uwe Kleine-König 2024-02-14 10:31:25 +01:00
parent e80c1aa6ae
commit 74836319c2

View File

@ -233,7 +233,7 @@ static int fsl_pwm_apply_config(struct pwm_chip *chip,
bool do_write_period = false;
if (!fsl_pwm_calculate_period(fpc, newstate->period, &periodcfg)) {
dev_err(chip->dev, "failed to calculate new period\n");
dev_err(pwmchip_parent(chip), "failed to calculate new period\n");
return -EINVAL;
}
@ -247,7 +247,7 @@ static int fsl_pwm_apply_config(struct pwm_chip *chip,
*/
else if (!fsl_pwm_periodcfg_are_equal(&fpc->period, &periodcfg)) {
if (fsl_pwm_is_other_pwm_enabled(fpc, pwm)) {
dev_err(chip->dev,
dev_err(pwmchip_parent(chip),
"Cannot change period for PWM %u, disable other PWMs first\n",
pwm->hwpwm);
return -EBUSY;