summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pc87360.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2022-09-19 12:31:54 +0200
committerGuenter Roeck <linux@roeck-us.net>2022-09-25 14:22:11 -0700
commit02e0500553890dd11bb2d20d9b865d0af7a6ec22 (patch)
treeee84e32aed283b0ddddbbfcac9550193a6fd0272 /drivers/hwmon/pc87360.c
parentb99152d4f04b379e31db6c1a2dda6b272c92039b (diff)
downloadlinux-stable-02e0500553890dd11bb2d20d9b865d0af7a6ec22.tar.gz
linux-stable-02e0500553890dd11bb2d20d9b865d0af7a6ec22.tar.bz2
linux-stable-02e0500553890dd11bb2d20d9b865d0af7a6ec22.zip
hwmon: (pc87360) Introduce a #define for the driver name and use it
Make use of the cpp symbol DRIVER_NAME to set the driver's name and also as name for devm_request_region(). While at it add a module alias using the new define. This is a preparation for the next cleanup commit that removes a cyclic dependency between pc87360_driver (which references pc87360_probe in .probe) and pc87360_probe() (which used pc87360_driver.driver.name). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220919103155.795151-2-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pc87360.c')
-rw-r--r--drivers/hwmon/pc87360.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
index 0828436a1f6c..b912926c8b18 100644
--- a/drivers/hwmon/pc87360.c
+++ b/drivers/hwmon/pc87360.c
@@ -35,6 +35,8 @@
#include <linux/acpi.h>
#include <linux/io.h>
+#define DRIVER_NAME "pc87360"
+
static u8 devid;
static struct platform_device *pdev;
static unsigned short extra_isa[3];
@@ -228,10 +230,9 @@ static struct pc87360_data *pc87360_update_device(struct device *dev);
/*
* Driver data
*/
-
static struct platform_driver pc87360_driver = {
.driver = {
- .name = "pc87360",
+ .name = DRIVER_NAME,
},
.probe = pc87360_probe,
.remove = pc87360_remove,
@@ -1239,7 +1240,7 @@ static int pc87360_probe(struct platform_device *pdev)
data->address[i] = extra_isa[i];
if (data->address[i]
&& !devm_request_region(dev, extra_isa[i], PC87360_EXTENT,
- pc87360_driver.driver.name)) {
+ DRIVER_NAME)) {
dev_err(dev,
"Region 0x%x-0x%x already in use!\n",
extra_isa[i], extra_isa[i]+PC87360_EXTENT-1);
@@ -1781,6 +1782,7 @@ static void __exit pc87360_exit(void)
MODULE_AUTHOR("Jean Delvare <jdelvare@suse.de>");
MODULE_DESCRIPTION("PC8736x hardware monitor");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:" DRIVER_NAME);
module_init(pc87360_init);
module_exit(pc87360_exit);