]> Git Repo - J-linux.git/commitdiff
pwm: crc: Make use of pwmchip_parent() accessor
authorUwe Kleine-König <[email protected]>
Wed, 14 Feb 2024 09:31:14 +0000 (10:31 +0100)
committerUwe Kleine-König <[email protected]>
Thu, 15 Feb 2024 11:59:21 +0000 (12:59 +0100)
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 <[email protected]>
drivers/pwm/pwm-crc.c

index d985a9d3336d38ba7325b55329eb62c476d23214..c8a852345a9757a34106d7f7f2ab3ef15327ad4d 100644 (file)
@@ -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;
 
This page took 0.046816 seconds and 4 git commands to generate.