* [PATCH] pwm: crc: Use consistent variable naming for driver data
@ 2023-11-30 7:41 Uwe Kleine-König
2023-11-30 9:28 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2023-11-30 7:41 UTC (permalink / raw)
To: Thierry Reding; +Cc: kernel, linux-pwm, Hans de Goede
All but one local variable of type pointer to struct crystalcove_pwm are
called "crc_pwm", the one outlier is called "pwm" which is usually
reserved for variables of type pointer to struct pwm_device.
So rename that one "pwm" to "crc_pwm" for consistency.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/pwm/pwm-crc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/pwm/pwm-crc.c b/drivers/pwm/pwm-crc.c
index 2b0b659eee97..e09358901ab5 100644
--- a/drivers/pwm/pwm-crc.c
+++ b/drivers/pwm/pwm-crc.c
@@ -160,22 +160,22 @@ static const struct pwm_ops crc_pwm_ops = {
static int crystalcove_pwm_probe(struct platform_device *pdev)
{
- struct crystalcove_pwm *pwm;
+ struct crystalcove_pwm *crc_pwm;
struct device *dev = pdev->dev.parent;
struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
- pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL);
- if (!pwm)
+ crc_pwm = devm_kzalloc(&pdev->dev, sizeof(*crc_pwm), GFP_KERNEL);
+ if (!crc_pwm)
return -ENOMEM;
- pwm->chip.dev = &pdev->dev;
- pwm->chip.ops = &crc_pwm_ops;
- pwm->chip.npwm = 1;
+ crc_pwm->chip.dev = &pdev->dev;
+ crc_pwm->chip.ops = &crc_pwm_ops;
+ crc_pwm->chip.npwm = 1;
/* get the PMIC regmap */
- pwm->regmap = pmic->regmap;
+ crc_pwm->regmap = pmic->regmap;
- return devm_pwmchip_add(&pdev->dev, &pwm->chip);
+ return devm_pwmchip_add(&pdev->dev, &crc_pwm->chip);
}
static struct platform_driver crystalcove_pwm_driver = {
base-commit: 53a2eaaf19c4e652ac53b5b2441582a555768516
--
2.42.0.586.gbc5204569f7d.dirty
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pwm: crc: Use consistent variable naming for driver data
2023-11-30 7:41 [PATCH] pwm: crc: Use consistent variable naming for driver data Uwe Kleine-König
@ 2023-11-30 9:28 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2023-11-30 9:28 UTC (permalink / raw)
To: Uwe Kleine-König, Thierry Reding; +Cc: kernel, linux-pwm
Hi,
On 11/30/23 08:41, Uwe Kleine-König wrote:
> All but one local variable of type pointer to struct crystalcove_pwm are
> called "crc_pwm", the one outlier is called "pwm" which is usually
> reserved for variables of type pointer to struct pwm_device.
>
> So rename that one "pwm" to "crc_pwm" for consistency.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/pwm/pwm-crc.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/pwm/pwm-crc.c b/drivers/pwm/pwm-crc.c
> index 2b0b659eee97..e09358901ab5 100644
> --- a/drivers/pwm/pwm-crc.c
> +++ b/drivers/pwm/pwm-crc.c
> @@ -160,22 +160,22 @@ static const struct pwm_ops crc_pwm_ops = {
>
> static int crystalcove_pwm_probe(struct platform_device *pdev)
> {
> - struct crystalcove_pwm *pwm;
> + struct crystalcove_pwm *crc_pwm;
> struct device *dev = pdev->dev.parent;
> struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
>
> - pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL);
> - if (!pwm)
> + crc_pwm = devm_kzalloc(&pdev->dev, sizeof(*crc_pwm), GFP_KERNEL);
> + if (!crc_pwm)
> return -ENOMEM;
>
> - pwm->chip.dev = &pdev->dev;
> - pwm->chip.ops = &crc_pwm_ops;
> - pwm->chip.npwm = 1;
> + crc_pwm->chip.dev = &pdev->dev;
> + crc_pwm->chip.ops = &crc_pwm_ops;
> + crc_pwm->chip.npwm = 1;
>
> /* get the PMIC regmap */
> - pwm->regmap = pmic->regmap;
> + crc_pwm->regmap = pmic->regmap;
>
> - return devm_pwmchip_add(&pdev->dev, &pwm->chip);
> + return devm_pwmchip_add(&pdev->dev, &crc_pwm->chip);
> }
>
> static struct platform_driver crystalcove_pwm_driver = {
>
> base-commit: 53a2eaaf19c4e652ac53b5b2441582a555768516
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-30 9:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-30 7:41 [PATCH] pwm: crc: Use consistent variable naming for driver data Uwe Kleine-König
2023-11-30 9:28 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox