Skip to content

Commit

Permalink
pwm: Stop referencing pwm->chip
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thierry Reding committed Dec 20, 2023
1 parent 2d91123 commit 80943bb
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-bcm-kona.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-img.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-jz4740.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-lpc18xx-sct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-lpc32xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-mediatek.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-renesas-tpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-sti.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-stmpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions drivers/pwm/pwm-twl-led.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions drivers/pwm/pwm-twl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-vt8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 80943bb

Please sign in to comment.