Skip to content

Commit 635d324

Browse files
zhaoxiaothierryreding
authored andcommitted
pwm: vt8500: Rename variable pointing to driver private data
Status quo is that variables of type struct vt8500_chip * are named "vt8500", "chip". Because usually only struct pwm_device * variables are named "pwm" and "chip" is usually used for variabled of type struct pwm_chip *. So consistently use the same and non-conflicting name "vt8500". Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent 4f34ebb commit 635d324

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

drivers/pwm/pwm-vt8500.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ MODULE_DEVICE_TABLE(of, vt8500_pwm_dt_ids);
235235

236236
static int vt8500_pwm_probe(struct platform_device *pdev)
237237
{
238-
struct vt8500_chip *chip;
238+
struct vt8500_chip *vt8500;
239239
struct device_node *np = pdev->dev.of_node;
240240
int ret;
241241

@@ -244,48 +244,48 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
244244
return -EINVAL;
245245
}
246246

247-
chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
248-
if (chip == NULL)
247+
vt8500 = devm_kzalloc(&pdev->dev, sizeof(*vt8500), GFP_KERNEL);
248+
if (vt8500 == NULL)
249249
return -ENOMEM;
250250

251-
chip->chip.dev = &pdev->dev;
252-
chip->chip.ops = &vt8500_pwm_ops;
253-
chip->chip.npwm = VT8500_NR_PWMS;
251+
vt8500->chip.dev = &pdev->dev;
252+
vt8500->chip.ops = &vt8500_pwm_ops;
253+
vt8500->chip.npwm = VT8500_NR_PWMS;
254254

255-
chip->clk = devm_clk_get(&pdev->dev, NULL);
256-
if (IS_ERR(chip->clk)) {
255+
vt8500->clk = devm_clk_get(&pdev->dev, NULL);
256+
if (IS_ERR(vt8500->clk)) {
257257
dev_err(&pdev->dev, "clock source not specified\n");
258-
return PTR_ERR(chip->clk);
258+
return PTR_ERR(vt8500->clk);
259259
}
260260

261-
chip->base = devm_platform_ioremap_resource(pdev, 0);
262-
if (IS_ERR(chip->base))
263-
return PTR_ERR(chip->base);
261+
vt8500->base = devm_platform_ioremap_resource(pdev, 0);
262+
if (IS_ERR(vt8500->base))
263+
return PTR_ERR(vt8500->base);
264264

265-
ret = clk_prepare(chip->clk);
265+
ret = clk_prepare(vt8500->clk);
266266
if (ret < 0) {
267267
dev_err(&pdev->dev, "failed to prepare clock\n");
268268
return ret;
269269
}
270270

271-
ret = pwmchip_add(&chip->chip);
271+
ret = pwmchip_add(&vt8500->chip);
272272
if (ret < 0) {
273273
dev_err(&pdev->dev, "failed to add PWM chip\n");
274-
clk_unprepare(chip->clk);
274+
clk_unprepare(vt8500->clk);
275275
return ret;
276276
}
277277

278-
platform_set_drvdata(pdev, chip);
278+
platform_set_drvdata(pdev, vt8500);
279279
return ret;
280280
}
281281

282282
static int vt8500_pwm_remove(struct platform_device *pdev)
283283
{
284-
struct vt8500_chip *chip = platform_get_drvdata(pdev);
284+
struct vt8500_chip *vt8500 = platform_get_drvdata(pdev);
285285

286-
pwmchip_remove(&chip->chip);
286+
pwmchip_remove(&vt8500->chip);
287287

288-
clk_unprepare(chip->clk);
288+
clk_unprepare(vt8500->clk);
289289

290290
return 0;
291291
}

0 commit comments

Comments
 (0)