All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH 4/4] hwmon: (smsc47m1) Rename global platform device variable
Date: Thu,  7 Dec 2023 15:09:32 +0100	[thread overview]
Message-ID: <68a959b56da7f9452557d08c72249182364b0dd0.1701957841.git.u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <cover.1701957840.git.u.kleine-koenig@pengutronix.de>

pdev is a bad name for a global variable. Still more as the driver has
functions where pdev is a local variable. Rename it to smsc47m1_pdev.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/hwmon/smsc47m1.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
index 7e9c183b8e7f..ad52839e4f31 100644
--- a/drivers/hwmon/smsc47m1.c
+++ b/drivers/hwmon/smsc47m1.c
@@ -33,7 +33,7 @@ static unsigned short force_id;
 module_param(force_id, ushort, 0);
 MODULE_PARM_DESC(force_id, "Override the detected device ID");
 
-static struct platform_device *pdev;
+static struct platform_device *smsc47m1_pdev;
 
 #define DRVNAME "smsc47m1"
 enum chips { smsc47m1, smsc47m2 };
@@ -885,10 +885,10 @@ static int __init smsc47m1_device_add(unsigned short address,
 		return err;
 
 
-	pdev = platform_device_register_full(&pdevinfo);
-	if (IS_ERR(pdev)) {
+	smsc47m1_pdev = platform_device_register_full(&pdevinfo);
+	if (IS_ERR(smsc47m1_pdev)) {
 		pr_err("Device allocation failed\n");
-		return PTR_ERR(pdev);
+		return PTR_ERR(smsc47m1_pdev);
 	}
 
 	return 0;
@@ -905,7 +905,7 @@ static int __init sm_smsc47m1_init(void)
 		return err;
 	address = err;
 
-	/* Sets global pdev as a side effect */
+	/* Sets global smsc47m1_pdev as a side effect */
 	err = smsc47m1_device_add(address, &sio_data);
 	if (err)
 		return err;
@@ -917,7 +917,7 @@ static int __init sm_smsc47m1_init(void)
 	return 0;
 
 exit_device:
-	platform_device_unregister(pdev);
+	platform_device_unregister(smsc47m1_pdev);
 	smsc47m1_restore(&sio_data);
 	return err;
 }
@@ -925,8 +925,8 @@ static int __init sm_smsc47m1_init(void)
 static void __exit sm_smsc47m1_exit(void)
 {
 	platform_driver_unregister(&smsc47m1_driver);
-	smsc47m1_restore(dev_get_platdata(&pdev->dev));
-	platform_device_unregister(pdev);
+	smsc47m1_restore(dev_get_platdata(&smsc47m1_pdev->dev));
+	platform_device_unregister(smsc47m1_pdev);
 }
 
 MODULE_AUTHOR("Mark D. Studebaker <mdsxyz123@yahoo.com>");
-- 
2.42.0


  parent reply	other threads:[~2023-12-07 14:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 14:09 [PATCH 0/4] hwmon: (smsc47m1) Various improvements Uwe Kleine-König
2023-12-07 14:09 ` [PATCH 1/4] hwmon: (smsc47m1) Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
2023-12-11 14:35   ` Guenter Roeck
2023-12-07 14:09 ` [PATCH 2/4] hwmon: (smsc47m1) Convert to platform remove callback returning void Uwe Kleine-König
2023-12-11 14:36   ` Guenter Roeck
2023-12-07 14:09 ` [PATCH 3/4] hwmon: (smsc47m1) Simplify device registration Uwe Kleine-König
2023-12-11 14:39   ` Guenter Roeck
2023-12-11 16:50     ` Uwe Kleine-König
2023-12-07 14:09 ` Uwe Kleine-König [this message]
2023-12-11 14:40   ` [PATCH 4/4] hwmon: (smsc47m1) Rename global platform device variable Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68a959b56da7f9452557d08c72249182364b0dd0.1701957841.git.u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=jdelvare@suse.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.