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

pwm: atmel: 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/f8ca10033204111e4eb2e7a4dad0bd1f7586c735.1707900770.git.u.kleine-koenig@pengutronix.deSigned-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent cc2b5bc6
...@@ -210,7 +210,7 @@ static int atmel_pwm_calculate_cprd_and_pres(struct pwm_chip *chip, ...@@ -210,7 +210,7 @@ static int atmel_pwm_calculate_cprd_and_pres(struct pwm_chip *chip,
shift = fls(cycles) - atmel_pwm->data->cfg.period_bits; shift = fls(cycles) - atmel_pwm->data->cfg.period_bits;
if (shift > PWM_MAX_PRES) { if (shift > PWM_MAX_PRES) {
dev_err(chip->dev, "pres exceeds the maximum value\n"); dev_err(pwmchip_parent(chip), "pres exceeds the maximum value\n");
return -EINVAL; return -EINVAL;
} else if (shift > 0) { } else if (shift > 0) {
*pres = shift; *pres = shift;
...@@ -318,7 +318,7 @@ static int atmel_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, ...@@ -318,7 +318,7 @@ static int atmel_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
ret = atmel_pwm_calculate_cprd_and_pres(chip, clkrate, state, &cprd, ret = atmel_pwm_calculate_cprd_and_pres(chip, clkrate, state, &cprd,
&pres); &pres);
if (ret) { if (ret) {
dev_err(chip->dev, dev_err(pwmchip_parent(chip),
"failed to calculate cprd and prescaler\n"); "failed to calculate cprd and prescaler\n");
return ret; return ret;
} }
...@@ -330,7 +330,7 @@ static int atmel_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, ...@@ -330,7 +330,7 @@ static int atmel_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
} else { } else {
ret = clk_enable(atmel_pwm->clk); ret = clk_enable(atmel_pwm->clk);
if (ret) { if (ret) {
dev_err(chip->dev, "failed to enable clock\n"); dev_err(pwmchip_parent(chip), "failed to enable clock\n");
return ret; return ret;
} }
} }
...@@ -478,7 +478,7 @@ static int atmel_pwm_enable_clk_if_on(struct pwm_chip *chip, bool on) ...@@ -478,7 +478,7 @@ static int atmel_pwm_enable_clk_if_on(struct pwm_chip *chip, bool on)
for (i = 0; i < cnt; i++) { for (i = 0; i < cnt; i++) {
ret = clk_enable(atmel_pwm->clk); ret = clk_enable(atmel_pwm->clk);
if (ret) { if (ret) {
dev_err(chip->dev, dev_err(pwmchip_parent(chip),
"failed to enable clock for pwm %pe\n", "failed to enable clock for pwm %pe\n",
ERR_PTR(ret)); ERR_PTR(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