mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] power: reset: qcom-pon: Rename variables to use generic naming
@ 2025-05-20 21:27 Taeyoung Kwon
  2025-05-20 21:31 ` Dmitry Baryshkov
  0 siblings, 1 reply; 2+ messages in thread
From: Taeyoung Kwon @ 2025-05-20 21:27 UTC (permalink / raw)
  To: Sebastian Reichel, linux-arm-msm, linux-pm, linux-kernel; +Cc: Taeyoung Kwon

The qcom-pon driver was originally implemented for the PM8916 PMIC, and
as a result, several internal variable names still refer to 'pm8916'.
However, the driver has since been extended to support other PMICs as
well.

This patch renames those variables to use more generic and consistent
names, improving clarity and reducing confusion for non-PM8916 devices.

Signed-off-by: Taeyoung Kwon <Taeyoung.Kwon@telit.com>
---
From: Taeyoung Kwon <Taeyoung.Kwon@telit.com>

Changes in v1:
- Moved explanation under the '---' line

Since my company email automatically adds a footer signature,
I’m sending this patch from my personal Gmail account.
Is this acceptable, or should I resend the patch using
an email that matches the Signed-off-by line?

 drivers/power/reset/qcom-pon.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c
index 1344b361a475..7e108982a582 100644
--- a/drivers/power/reset/qcom-pon.c
+++ b/drivers/power/reset/qcom-pon.c
@@ -19,7 +19,7 @@
 
 #define NO_REASON_SHIFT			0
 
-struct pm8916_pon {
+struct qcom_pon {
 	struct device *dev;
 	struct regmap *regmap;
 	u32 baseaddr;
@@ -27,11 +27,11 @@ struct pm8916_pon {
 	long reason_shift;
 };
 
-static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot,
+static int qcom_pon_reboot_mode_write(struct reboot_mode_driver *reboot,
 				    unsigned int magic)
 {
-	struct pm8916_pon *pon = container_of
-			(reboot, struct pm8916_pon, reboot_mode);
+	struct qcom_pon *pon = container_of
+			(reboot, struct qcom_pon, reboot_mode);
 	int ret;
 
 	ret = regmap_update_bits(pon->regmap,
@@ -44,9 +44,9 @@ static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot,
 	return ret;
 }
 
-static int pm8916_pon_probe(struct platform_device *pdev)
+static int qcom_pon_probe(struct platform_device *pdev)
 {
-	struct pm8916_pon *pon;
+	struct qcom_pon *pon;
 	long reason_shift;
 	int error;
 
@@ -72,7 +72,7 @@ static int pm8916_pon_probe(struct platform_device *pdev)
 	if (reason_shift != NO_REASON_SHIFT) {
 		pon->reboot_mode.dev = &pdev->dev;
 		pon->reason_shift = reason_shift;
-		pon->reboot_mode.write = pm8916_reboot_mode_write;
+		pon->reboot_mode.write = qcom_pon_reboot_mode_write;
 		error = devm_reboot_mode_register(&pdev->dev, &pon->reboot_mode);
 		if (error) {
 			dev_err(&pdev->dev, "can't register reboot mode\n");
@@ -85,7 +85,7 @@ static int pm8916_pon_probe(struct platform_device *pdev)
 	return devm_of_platform_populate(&pdev->dev);
 }
 
-static const struct of_device_id pm8916_pon_id_table[] = {
+static const struct of_device_id qcom_pon_id_table[] = {
 	{ .compatible = "qcom,pm8916-pon", .data = (void *)GEN1_REASON_SHIFT },
 	{ .compatible = "qcom,pm8941-pon", .data = (void *)NO_REASON_SHIFT },
 	{ .compatible = "qcom,pms405-pon", .data = (void *)GEN1_REASON_SHIFT },
@@ -93,16 +93,16 @@ static const struct of_device_id pm8916_pon_id_table[] = {
 	{ .compatible = "qcom,pmk8350-pon", .data = (void *)GEN2_REASON_SHIFT },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, pm8916_pon_id_table);
+MODULE_DEVICE_TABLE(of, qcom_pon_id_table);
 
-static struct platform_driver pm8916_pon_driver = {
-	.probe = pm8916_pon_probe,
+static struct platform_driver qcom_pon_driver = {
+	.probe = qcom_pon_probe,
 	.driver = {
-		.name = "pm8916-pon",
-		.of_match_table = pm8916_pon_id_table,
+		.name = "qcom-pon",
+		.of_match_table = qcom_pon_id_table,
 	},
 };
-module_platform_driver(pm8916_pon_driver);
+module_platform_driver(qcom_pon_driver);
 
-MODULE_DESCRIPTION("pm8916 Power On driver");
+MODULE_DESCRIPTION("Qualcomm Power On driver");
 MODULE_LICENSE("GPL v2");
-- 
2.49.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] power: reset: qcom-pon: Rename variables to use generic naming
  2025-05-20 21:27 [PATCH v1] power: reset: qcom-pon: Rename variables to use generic naming Taeyoung Kwon
@ 2025-05-20 21:31 ` Dmitry Baryshkov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Baryshkov @ 2025-05-20 21:31 UTC (permalink / raw)
  To: Taeyoung Kwon
  Cc: Sebastian Reichel, linux-arm-msm, linux-pm, linux-kernel, Taeyoung Kwon

On Tue, May 20, 2025 at 09:27:20PM +0000, Taeyoung Kwon wrote:
> The qcom-pon driver was originally implemented for the PM8916 PMIC, and
> as a result, several internal variable names still refer to 'pm8916'.
> However, the driver has since been extended to support other PMICs as
> well.
> 
> This patch renames those variables to use more generic and consistent
> names, improving clarity and reducing confusion for non-PM8916 devices.
> 
> Signed-off-by: Taeyoung Kwon <Taeyoung.Kwon@telit.com>
> ---
> From: Taeyoung Kwon <Taeyoung.Kwon@telit.com>

I'm sorry for not being clear enough. This should be the first line of
the commit message text (with an empty line afterwards).

> 
> Changes in v1:
> - Moved explanation under the '---' line
> 
> Since my company email automatically adds a footer signature,
> I’m sending this patch from my personal Gmail account.
> Is this acceptable, or should I resend the patch using
> an email that matches the Signed-off-by line?
> 
>  drivers/power/reset/qcom-pon.c | 30 +++++++++++++++---------------
>  1 file changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c
> index 1344b361a475..7e108982a582 100644
> --- a/drivers/power/reset/qcom-pon.c
> +++ b/drivers/power/reset/qcom-pon.c
> @@ -19,7 +19,7 @@
>  
>  #define NO_REASON_SHIFT			0
>  
> -struct pm8916_pon {
> +struct qcom_pon {
>  	struct device *dev;
>  	struct regmap *regmap;
>  	u32 baseaddr;
> @@ -27,11 +27,11 @@ struct pm8916_pon {
>  	long reason_shift;
>  };
>  
> -static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot,
> +static int qcom_pon_reboot_mode_write(struct reboot_mode_driver *reboot,
>  				    unsigned int magic)
>  {
> -	struct pm8916_pon *pon = container_of
> -			(reboot, struct pm8916_pon, reboot_mode);
> +	struct qcom_pon *pon = container_of
> +			(reboot, struct qcom_pon, reboot_mode);
>  	int ret;
>  
>  	ret = regmap_update_bits(pon->regmap,
> @@ -44,9 +44,9 @@ static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot,
>  	return ret;
>  }
>  
> -static int pm8916_pon_probe(struct platform_device *pdev)
> +static int qcom_pon_probe(struct platform_device *pdev)
>  {
> -	struct pm8916_pon *pon;
> +	struct qcom_pon *pon;
>  	long reason_shift;
>  	int error;
>  
> @@ -72,7 +72,7 @@ static int pm8916_pon_probe(struct platform_device *pdev)
>  	if (reason_shift != NO_REASON_SHIFT) {
>  		pon->reboot_mode.dev = &pdev->dev;
>  		pon->reason_shift = reason_shift;
> -		pon->reboot_mode.write = pm8916_reboot_mode_write;
> +		pon->reboot_mode.write = qcom_pon_reboot_mode_write;
>  		error = devm_reboot_mode_register(&pdev->dev, &pon->reboot_mode);
>  		if (error) {
>  			dev_err(&pdev->dev, "can't register reboot mode\n");
> @@ -85,7 +85,7 @@ static int pm8916_pon_probe(struct platform_device *pdev)
>  	return devm_of_platform_populate(&pdev->dev);
>  }
>  
> -static const struct of_device_id pm8916_pon_id_table[] = {
> +static const struct of_device_id qcom_pon_id_table[] = {
>  	{ .compatible = "qcom,pm8916-pon", .data = (void *)GEN1_REASON_SHIFT },
>  	{ .compatible = "qcom,pm8941-pon", .data = (void *)NO_REASON_SHIFT },
>  	{ .compatible = "qcom,pms405-pon", .data = (void *)GEN1_REASON_SHIFT },
> @@ -93,16 +93,16 @@ static const struct of_device_id pm8916_pon_id_table[] = {
>  	{ .compatible = "qcom,pmk8350-pon", .data = (void *)GEN2_REASON_SHIFT },
>  	{ }
>  };
> -MODULE_DEVICE_TABLE(of, pm8916_pon_id_table);
> +MODULE_DEVICE_TABLE(of, qcom_pon_id_table);
>  
> -static struct platform_driver pm8916_pon_driver = {
> -	.probe = pm8916_pon_probe,
> +static struct platform_driver qcom_pon_driver = {
> +	.probe = qcom_pon_probe,
>  	.driver = {
> -		.name = "pm8916-pon",
> -		.of_match_table = pm8916_pon_id_table,
> +		.name = "qcom-pon",
> +		.of_match_table = qcom_pon_id_table,
>  	},
>  };
> -module_platform_driver(pm8916_pon_driver);
> +module_platform_driver(qcom_pon_driver);
>  
> -MODULE_DESCRIPTION("pm8916 Power On driver");
> +MODULE_DESCRIPTION("Qualcomm Power On driver");
>  MODULE_LICENSE("GPL v2");
> -- 
> 2.49.0
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-20 21:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-20 21:27 [PATCH v1] power: reset: qcom-pon: Rename variables to use generic naming Taeyoung Kwon
2025-05-20 21:31 ` Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®