diff mbox series

[v1,072/101] pwm: atmel: Stop using struct pwm_chip::dev

Message ID 20230808171931.944154-73-u.kleine-koenig@pengutronix.de
State Superseded
Headers show
Series pwm: Fix lifetime issues for pwm_chips | expand

Commit Message

Uwe Kleine-König Aug. 8, 2023, 5:19 p.m. UTC
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(-)
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
index 48b79b8488a4..0f6a53a14dd0 100644
--- a/drivers/pwm/pwm-atmel.c
+++ b/drivers/pwm/pwm-atmel.c
@@ -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;
 }