@@ -455,7 +455,7 @@ static const struct of_device_id atmel_pwm_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, atmel_pwm_dt_ids);
-static int atmel_pwm_enable_clk_if_on(struct pwm_chip *chip, bool on)
+static int atmel_pwm_enable_clk_if_on(struct device *dev, struct pwm_chip *chip, bool on)
{
struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip);
unsigned int i, cnt = 0;
@@ -474,7 +474,7 @@ static int atmel_pwm_enable_clk_if_on(struct pwm_chip *chip, bool on)
for (i = 0; i < cnt; i++) {
ret = clk_enable(atmel_pwm->clk);
if (ret) {
- dev_err_probe(chip->dev, ret,
+ dev_err_probe(dev, ret,
"failed to enable clock for pwm\n");
cnt = i;
@@ -518,7 +518,7 @@ static int atmel_pwm_probe(struct platform_device *pdev)
chip->ops = &atmel_pwm_ops;
- ret = atmel_pwm_enable_clk_if_on(chip, true);
+ ret = atmel_pwm_enable_clk_if_on(&pdev->dev, chip, true);
if (ret < 0)
return ret;
@@ -531,7 +531,7 @@ static int atmel_pwm_probe(struct platform_device *pdev)
return 0;
disable_clk:
- atmel_pwm_enable_clk_if_on(chip, false);
+ atmel_pwm_enable_clk_if_on(&pdev->dev, chip, false);
return ret;
}
struct pwm_chip::dev is about to change. To not have to touch this driver in the same commit as struct pwm_chip::dev, pass the parent device pointer to atmel_pwm_enable_clk_if_on(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/pwm/pwm-atmel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)