diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-02-14 10:32:59 +0100 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-02-22 14:39:26 +0100 |
commit | 62f59c107aac4ed7dd770699fbe8de625e6b8755 (patch) | |
tree | e8620f06e17af40752104de2dcdfc1c68a44b448 /drivers/pwm/pwm-tiecap.c | |
parent | 7550ebf04c05de66e504c17dc7c6ac5cf8802d8d (diff) | |
download | linux-stable-62f59c107aac4ed7dd770699fbe8de625e6b8755.tar.gz linux-stable-62f59c107aac4ed7dd770699fbe8de625e6b8755.tar.bz2 linux-stable-62f59c107aac4ed7dd770699fbe8de625e6b8755.zip |
pwm: tiecap: Simplify code to determine the pwmchip's parent device
There is already a pointer to the pwmchip, make use of it directly
instead of using the struct ecap_pwm_chip *pc just obtained from
it. This also has the advantage of not using struct ecap_pwm_chip::chip
any more which will be dropped soon.
Link: https://lore.kernel.org/r/628f4b8c4ba1321075fc1dff70453a1c79ffb814.1707900770.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'drivers/pwm/pwm-tiecap.c')
-rw-r--r-- | drivers/pwm/pwm-tiecap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pwm/pwm-tiecap.c b/drivers/pwm/pwm-tiecap.c index d974f4414ac9..b93e3be318d5 100644 --- a/drivers/pwm/pwm-tiecap.c +++ b/drivers/pwm/pwm-tiecap.c @@ -70,7 +70,7 @@ static int ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, duty_cycles = (u32)c; } - pm_runtime_get_sync(pc->chip.dev); + pm_runtime_get_sync(chip->dev); value = readw(pc->mmio_base + ECCTL2); @@ -100,7 +100,7 @@ static int ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, writew(value, pc->mmio_base + ECCTL2); } - pm_runtime_put_sync(pc->chip.dev); + pm_runtime_put_sync(chip->dev); return 0; } @@ -111,7 +111,7 @@ static int ecap_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm, struct ecap_pwm_chip *pc = to_ecap_pwm_chip(chip); u16 value; - pm_runtime_get_sync(pc->chip.dev); + pm_runtime_get_sync(chip->dev); value = readw(pc->mmio_base + ECCTL2); @@ -124,7 +124,7 @@ static int ecap_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm, writew(value, pc->mmio_base + ECCTL2); - pm_runtime_put_sync(pc->chip.dev); + pm_runtime_put_sync(chip->dev); return 0; } @@ -135,7 +135,7 @@ static int ecap_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) u16 value; /* Leave clock enabled on enabling PWM */ - pm_runtime_get_sync(pc->chip.dev); + pm_runtime_get_sync(chip->dev); /* * Enable 'Free run Time stamp counter mode' to start counter @@ -162,7 +162,7 @@ static void ecap_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) writew(value, pc->mmio_base + ECCTL2); /* Disable clock on PWM disable */ - pm_runtime_put_sync(pc->chip.dev); + pm_runtime_put_sync(chip->dev); } static int ecap_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, |