Skip to content

Commit bc83fe5

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: sl28cpld: Consistently name pwm_chip variables "chip"
Nearly all PWM drivers use the name "chip" for the member in the driver struct pointing to the pwm_chip. Also all local variables and function parameters with this type use this name. Rename the struct pwm_chip member accordingly for consistency. Also rename the parameter of the macro sl28cpld_pwm_from_chip to "chip". Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent daf3fac commit bc83fe5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/pwm/pwm-sl28cpld.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,15 @@
8080
regmap_write((priv)->regmap, (priv)->offset + (reg), (val))
8181

8282
struct sl28cpld_pwm {
83-
struct pwm_chip pwm_chip;
83+
struct pwm_chip chip;
8484
struct regmap *regmap;
8585
u32 offset;
8686
};
87-
#define sl28cpld_pwm_from_chip(_chip) \
88-
container_of(_chip, struct sl28cpld_pwm, pwm_chip)
87+
88+
static inline struct sl28cpld_pwm *sl28cpld_pwm_from_chip(struct pwm_chip *chip)
89+
{
90+
return container_of(chip, struct sl28cpld_pwm, chip);
91+
}
8992

9093
static int sl28cpld_pwm_get_state(struct pwm_chip *chip,
9194
struct pwm_device *pwm,
@@ -228,12 +231,12 @@ static int sl28cpld_pwm_probe(struct platform_device *pdev)
228231
}
229232

230233
/* Initialize the pwm_chip structure */
231-
chip = &priv->pwm_chip;
234+
chip = &priv->chip;
232235
chip->dev = &pdev->dev;
233236
chip->ops = &sl28cpld_pwm_ops;
234237
chip->npwm = 1;
235238

236-
ret = devm_pwmchip_add(&pdev->dev, &priv->pwm_chip);
239+
ret = devm_pwmchip_add(&pdev->dev, chip);
237240
if (ret) {
238241
dev_err(&pdev->dev, "failed to add PWM chip (%pe)",
239242
ERR_PTR(ret));

0 commit comments

Comments
 (0)