pwm: Stop referencing pwm->chip
authorThierry Reding <thierry.reding@gmail.com>
Fri, 1 Dec 2023 10:22:53 +0000 (11:22 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 20 Dec 2023 15:04:14 +0000 (16:04 +0100)
Drivers have access to the chip via a function argument already, so
there is no need to reference it via the PWM device.

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
13 files changed:
drivers/pwm/pwm-bcm-kona.c
drivers/pwm/pwm-img.c
drivers/pwm/pwm-jz4740.c
drivers/pwm/pwm-lpc18xx-sct.c
drivers/pwm/pwm-lpc32xx.c
drivers/pwm/pwm-mediatek.c
drivers/pwm/pwm-renesas-tpu.c
drivers/pwm/pwm-sti.c
drivers/pwm/pwm-stmpe.c
drivers/pwm/pwm-tegra.c
drivers/pwm/pwm-twl-led.c
drivers/pwm/pwm-twl.c
drivers/pwm/pwm-vt8500.c

index 15d6ed03c3ce05a58db5d65e8fb1f3532b35635f..45046a5c20a5e5202598653aa6b0596e99229347 100644 (file)
@@ -260,7 +260,7 @@ static int kona_pwmc_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                        return err;
        }
 
-       err = kona_pwmc_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = kona_pwmc_config(chip, pwm, state->duty_cycle, state->period);
        if (err && !pwm->state.enabled)
                clk_disable_unprepare(kp->clk);
 
index 0d218c0b690ed9c0ce6c382649efb93f780bdfaf..5965ac35b32eac9d560132a9498f3e525373fd61 100644 (file)
@@ -196,7 +196,7 @@ static int img_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = img_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = img_pwm_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;
 
index 73f96cef1662130a84e0e336f233b45dda79fa20..80dcff237a15540c0c132ccd8b46546e063726c6 100644 (file)
@@ -123,7 +123,7 @@ static void jz4740_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 static int jz4740_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                            const struct pwm_state *state)
 {
-       struct jz4740_pwm_chip *jz = to_jz4740(pwm->chip);
+       struct jz4740_pwm_chip *jz = to_jz4740(chip);
        unsigned long long tmp = 0xffffull * NSEC_PER_SEC;
        struct clk *clk = jz->clk[pwm->hwpwm];
        unsigned long period, duty;
index ef7d0da137ede3453684322dc3e2312d6ff0e59e..b3d4a955aa3119eb3483197bfd44a844a41cb02d 100644 (file)
@@ -328,7 +328,7 @@ static int lpc18xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = lpc18xx_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = lpc18xx_pwm_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;
 
index 78f664e41e6e3a174f16ed0ecc216f2e0b1ae087..1d9f3e7a2434ae55e515d64acacadb212b3bb776 100644 (file)
@@ -103,7 +103,7 @@ static int lpc32xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = lpc32xx_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = lpc32xx_pwm_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;
 
index 373abfd25acb28509520e82ce6b3efc13896e9d9..17d290f847af60841b0928602e9df1aa8c1342bc 100644 (file)
@@ -217,7 +217,7 @@ static int pwm_mediatek_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = pwm_mediatek_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = pwm_mediatek_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;
 
index 4239f2c3e8b2a3288bfe43d2a7e7a2cb98a9b2b5..ce92db1f851131617a0c46f25fac418d2763c437 100644 (file)
@@ -416,7 +416,7 @@ static int tpu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = tpu_pwm_config(pwm->chip, pwm,
+       err = tpu_pwm_config(chip, pwm,
                             state->duty_cycle, state->period, enabled);
        if (err)
                return err;
index dc92cea31cd0782021c13fe7064e249b111a4efb..6cf55cf34d39f6d9df7ed4164eb8eb1c81720dc8 100644 (file)
@@ -407,7 +407,7 @@ static int sti_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = sti_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = sti_pwm_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;
 
index a46f5b4dd81622ce3651f6c35c5fc4ff0b91b83a..d730631c6583acd0051058f1014cb49e3c3febf2 100644 (file)
@@ -275,7 +275,7 @@ static int stmpe_24xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = stmpe_24xx_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = stmpe_24xx_pwm_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;
 
index 39ea51e08c946d0ec24a7cc311fc930b3ca1b823..82ee2f0754f965cfd36b0196794985204c412f58 100644 (file)
@@ -256,7 +256,7 @@ static int tegra_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = tegra_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = tegra_pwm_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;
 
index 625233f4703a972462c2d096bd1b7ca79c1fb5db..8a870d0db3c6974d8121115d9f9400c67a8f7ffe 100644 (file)
@@ -175,7 +175,7 @@ static int twl4030_pwmled_apply(struct pwm_chip *chip, struct pwm_device *pwm,
         * pwm_apply_state because of !state->enabled and so the two values in
         * pwm->state might not be configured in hardware.
         */
-       ret = twl4030_pwmled_config(pwm->chip, pwm,
+       ret = twl4030_pwmled_config(chip, pwm,
                                    state->duty_cycle, state->period);
        if (ret)
                return ret;
@@ -275,7 +275,7 @@ static int twl6030_pwmled_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = twl6030_pwmled_config(pwm->chip, pwm,
+       err = twl6030_pwmled_config(chip, pwm,
                                    state->duty_cycle, state->period);
        if (err)
                return err;
index 603d31f27470f6b80b6cc347b2fcc44d0d855bb6..68e02c9a6bf9a1e519b91e537ebf44495813c793 100644 (file)
@@ -294,7 +294,7 @@ static int twl4030_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = twl_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = twl_pwm_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;
 
@@ -319,7 +319,7 @@ static int twl6030_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                return 0;
        }
 
-       err = twl_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = twl_pwm_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;
 
index 5568d5312d3caf4d148692fd4a383053c1576747..bdea60389487e9d48606bab2bf7e1f61e283f156 100644 (file)
@@ -209,7 +209,7 @@ static int vt8500_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
         * pwm_apply_state because of !state->enabled and so the two values in
         * pwm->state might not be configured in hardware.
         */
-       err = vt8500_pwm_config(pwm->chip, pwm, state->duty_cycle, state->period);
+       err = vt8500_pwm_config(chip, pwm, state->duty_cycle, state->period);
        if (err)
                return err;