From aac1b805a61ced530b4d427354a205b4bbff69c6 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 14 Feb 2024 10:32:36 +0100 Subject: pwm: sprd: Drop duplicated tracking of the parent device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pwmchip stores a pointer to the parent device, so there is no need to store another copy in driver private data. Drop struct sprd_pwm_chip::dev and use the pwm_chip's parent pointer instead. Tested-by: Chunyan Zhang Link: https://lore.kernel.org/r/f85771f4bf659c0fdee30cf117b87fd877bad5e4.1707900770.git.u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König --- drivers/pwm/pwm-sprd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/pwm') diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c index 2e87666ad2b9..a38f50c3dc00 100644 --- a/drivers/pwm/pwm-sprd.c +++ b/drivers/pwm/pwm-sprd.c @@ -34,7 +34,6 @@ struct sprd_pwm_chn { struct sprd_pwm_chip { void __iomem *base; - struct device *dev; struct pwm_chip chip; struct sprd_pwm_chn chn[SPRD_PWM_CHN_NUM]; }; @@ -85,7 +84,7 @@ static int sprd_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, */ ret = clk_bulk_prepare_enable(SPRD_PWM_CHN_CLKS_NUM, chn->clks); if (ret) { - dev_err(spc->dev, "failed to enable pwm%u clocks\n", + dev_err(pwmchip_parent(chip), "failed to enable pwm%u clocks\n", pwm->hwpwm); return ret; } @@ -182,7 +181,7 @@ static int sprd_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, ret = clk_bulk_prepare_enable(SPRD_PWM_CHN_CLKS_NUM, chn->clks); if (ret) { - dev_err(spc->dev, + dev_err(pwmchip_parent(chip), "failed to enable pwm%u clocks\n", pwm->hwpwm); return ret; @@ -265,7 +264,6 @@ static int sprd_pwm_probe(struct platform_device *pdev) if (IS_ERR(spc->base)) return PTR_ERR(spc->base); - spc->dev = &pdev->dev; memcpy(spc->chn, chn, sizeof(chn)); spc->chip.dev = &pdev->dev; -- cgit v1.2.3