summaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-crc.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-02-14 10:31:14 +0100
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-02-15 12:59:21 +0100
commit5b86d1112b84f0736f1972316f4bf5a7cf657913 (patch)
tree16516ae0a706be510d23beef23b9effecd1a23ad /drivers/pwm/pwm-crc.c
parent4709f383083ae927f0e1a5e282ee9ace3ffb5f19 (diff)
downloadlwn-5b86d1112b84f0736f1972316f4bf5a7cf657913.tar.gz
lwn-5b86d1112b84f0736f1972316f4bf5a7cf657913.zip
pwm: crc: 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/a41b62365295be9debd4a9aaa80ca87fca35b320.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-crc.c')
-rw-r--r--drivers/pwm/pwm-crc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pwm/pwm-crc.c b/drivers/pwm/pwm-crc.c
index d985a9d3336d..c8a852345a97 100644
--- a/drivers/pwm/pwm-crc.c
+++ b/drivers/pwm/pwm-crc.c
@@ -55,7 +55,7 @@ static int crc_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
{
struct crystalcove_pwm *crc_pwm = to_crc_pwm(chip);
- struct device *dev = chip->dev;
+ struct device *dev = pwmchip_parent(chip);
int err;
if (state->period > PWM_MAX_PERIOD_NS) {
@@ -125,7 +125,7 @@ static int crc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
struct pwm_state *state)
{
struct crystalcove_pwm *crc_pwm = to_crc_pwm(chip);
- struct device *dev = chip->dev;
+ struct device *dev = pwmchip_parent(chip);
unsigned int clk_div, clk_div_reg, duty_cycle_reg;
int error;