* [PATCH v2] pwm: vt8500: Rename variable pointing to driver private data
@ 2022-02-11 2:37 zhaoxiao
2022-02-24 13:36 ` Thierry Reding
0 siblings, 1 reply; 2+ messages in thread
From: zhaoxiao @ 2022-02-11 2:37 UTC (permalink / raw)
To: thierry.reding, lee.jones
Cc: u.kleine-koenig, linux-arm-kernel, linux-pwm, linux-kernel, zhaoxiao
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>
---
v2: Rename the "chip" to "vt8500" for variable of type struct vt8500_chip *.
drivers/pwm/pwm-vt8500.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/pwm/pwm-vt8500.c b/drivers/pwm/pwm-vt8500.c
index 7170a315535b..f1ff9940b37c 100644
--- a/drivers/pwm/pwm-vt8500.c
+++ b/drivers/pwm/pwm-vt8500.c
@@ -235,7 +235,7 @@ MODULE_DEVICE_TABLE(of, vt8500_pwm_dt_ids);
static int vt8500_pwm_probe(struct platform_device *pdev)
{
- struct vt8500_chip *chip;
+ struct vt8500_chip *vt8500;
struct device_node *np = pdev->dev.of_node;
int ret;
@@ -244,48 +244,48 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
return -EINVAL;
}
- chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
- if (chip == NULL)
+ vt8500 = devm_kzalloc(&pdev->dev, sizeof(*vt8500), GFP_KERNEL);
+ if (vt8500 == NULL)
return -ENOMEM;
- chip->chip.dev = &pdev->dev;
- chip->chip.ops = &vt8500_pwm_ops;
- chip->chip.npwm = VT8500_NR_PWMS;
+ vt8500->chip.dev = &pdev->dev;
+ vt8500->chip.ops = &vt8500_pwm_ops;
+ vt8500->chip.npwm = VT8500_NR_PWMS;
- chip->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(chip->clk)) {
+ vt8500->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(vt8500->clk)) {
dev_err(&pdev->dev, "clock source not specified\n");
- return PTR_ERR(chip->clk);
+ return PTR_ERR(vt8500->clk);
}
- chip->base = devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(chip->base))
- return PTR_ERR(chip->base);
+ vt8500->base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(vt8500->base))
+ return PTR_ERR(vt8500->base);
- ret = clk_prepare(chip->clk);
+ ret = clk_prepare(vt8500->clk);
if (ret < 0) {
dev_err(&pdev->dev, "failed to prepare clock\n");
return ret;
}
- ret = pwmchip_add(&chip->chip);
+ ret = pwmchip_add(&vt8500->chip);
if (ret < 0) {
dev_err(&pdev->dev, "failed to add PWM chip\n");
- clk_unprepare(chip->clk);
+ clk_unprepare(vt8500->clk);
return ret;
}
- platform_set_drvdata(pdev, chip);
+ platform_set_drvdata(pdev, vt8500);
return ret;
}
static int vt8500_pwm_remove(struct platform_device *pdev)
{
- struct vt8500_chip *chip = platform_get_drvdata(pdev);
+ struct vt8500_chip *vt8500 = platform_get_drvdata(pdev);
- pwmchip_remove(&chip->chip);
+ pwmchip_remove(&vt8500->chip);
- clk_unprepare(chip->clk);
+ clk_unprepare(vt8500->clk);
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] pwm: vt8500: Rename variable pointing to driver private data
2022-02-11 2:37 [PATCH v2] pwm: vt8500: Rename variable pointing to driver private data zhaoxiao
@ 2022-02-24 13:36 ` Thierry Reding
0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2022-02-24 13:36 UTC (permalink / raw)
To: zhaoxiao
Cc: lee.jones, u.kleine-koenig, linux-arm-kernel, linux-pwm, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 665 bytes --]
On Fri, Feb 11, 2022 at 10:37:41AM +0800, zhaoxiao wrote:
> 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>
> ---
> v2: Rename the "chip" to "vt8500" for variable of type struct vt8500_chip *.
> drivers/pwm/pwm-vt8500.c | 38 +++++++++++++++++++-------------------
> 1 file changed, 19 insertions(+), 19 deletions(-)
Applied, thanks.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-24 13:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-11 2:37 [PATCH v2] pwm: vt8500: Rename variable pointing to driver private data zhaoxiao
2022-02-24 13:36 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).