Skip to contentSkip to conversation

hwmon: (i5500_temp) Convert to module_pci_driver

lm-sensors Axel Lin 3 participants 3 messages Oct 22, 2014 – Oct 23, 2014 Hardware monitoring

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

Use module_pci_driver to simplify the code a bit.

---
 drivers/hwmon/i5500_temp.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/hwmon/i5500_temp.c +1 -13
index ee3f6d9..82a6116 100644
@@ -171,7 +171,6 @@ static int i5500_temp_probe(struct pci_dev *pdev,
 							   "intel5500",
 							   data,
 							   i5500_temp_groups);
-
 	return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
@@ -181,19 +180,8 @@ static struct pci_driver i5500_temp_driver = {
 	.probe = i5500_temp_probe,
 };
 
-static int __init i5500_temp_init(void)
-{
-	return pci_register_driver(&i5500_temp_driver);
-}
-
-static void __exit i5500_temp_exit(void)
-{
-	pci_unregister_driver(&i5500_temp_driver);
-}
+module_pci_driver(i5500_temp_driver);
 
 MODULE_AUTHOR("Jean Delvare <[email protected]>");
 MODULE_DESCRIPTION("Intel 5500/5200/X58 chipset thermal sensor driver");
 MODULE_LICENSE("GPL");
-
-module_init(i5500_temp_init)
-module_exit(i5500_temp_exit)
Signature · 9 lines
1.9.1




_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer Reviewed-by
#1 lore raw
Quoted 12 lines · Axel Lin

Use module_pci_driver to simplify the code a bit.

---
 drivers/hwmon/i5500_temp.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/hwmon/i5500_temp.c +0 -0
index ee3f6d9..82a6116 100644

drivers/hwmon/i5500_temp.c static int i5500_temp_probe(struct pci_dev *pdev, · line 174

Quoted 4 lines
drivers/hwmon/i5500_temp.c +0 -1
@@ -171,7 +171,6 @@ static int i5500_temp_probe(struct pci_dev *pdev,
 							   "intel5500",
 							   data,
 							   i5500_temp_groups);
-

Always those whitespace changes ;-. I'd leave that up to Jean to decide if he wants an empty line at this place or not.

Otherwise makes sense and looks good.

Quoted 29 lines
drivers/hwmon/i5500_temp.c +1 -12
 	return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
@@ -181,19 +180,8 @@ static struct pci_driver i5500_temp_driver = {
 	.probe = i5500_temp_probe,
 };
 
-static int __init i5500_temp_init(void)
-{
-	return pci_register_driver(&i5500_temp_driver);
-}
-
-static void __exit i5500_temp_exit(void)
-{
-	pci_unregister_driver(&i5500_temp_driver);
-}
+module_pci_driver(i5500_temp_driver);
 
 MODULE_AUTHOR("Jean Delvare <[email protected]>");
 MODULE_DESCRIPTION("Intel 5500/5200/X58 chipset thermal sensor driver");
 MODULE_LICENSE("GPL");
-
-module_init(i5500_temp_init)
-module_exit(i5500_temp_exit)
Signature · 1 line
1.9.1

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw
In reply to Axel Lin
Quoted 8 lines · Guenter Roeck
Quoted 7 lines · Axel Lin

Use module_pci_driver to simplify the code a bit.

---
 drivers/hwmon/i5500_temp.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
Quoted 12 lines

drivers/hwmon/i5500_temp.c static int i5500_temp_probe(struct pci_dev *pdev, · line 174

Quoted 9 lines
drivers/hwmon/i5500_temp.c +0 -1
index ee3f6d9..82a6116 100644
@@ -171,7 +171,6 @@ static int i5500_temp_probe(struct pci_dev *pdev,
 							   "intel5500",
 							   data,
 							   i5500_temp_groups);
-

Always those whitespace changes ;-. I'd leave that up to Jean to decide if he wants an empty line at this place or not.

What I want is irrelevant, the important thing is that such a white space change does not belong to this patch, so I've reverted it.

Quoted 3 lines

Otherwise makes sense and looks good.

Patch applied (without the white space change), thanks Axel and Guenter.

Quoted 18 lines
Quoted 18 lines
drivers/hwmon/i5500_temp.c +1 -9
 	return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
@@ -181,19 +180,8 @@ static struct pci_driver i5500_temp_driver = {
 	.probe = i5500_temp_probe,
 };
 
-static int __init i5500_temp_init(void)
-{
-	return pci_register_driver(&i5500_temp_driver);
-}
-
-static void __exit i5500_temp_exit(void)
-{
-	pci_unregister_driver(&i5500_temp_driver);
-}
+module_pci_driver(i5500_temp_driver);
 
Quoted 6 lines

drivers/hwmon/i5500_temp.c static struct pci_driver i5500_temp_driver = { · line 199

Quoted 6 lines
drivers/hwmon/i5500_temp.c +0 -3
 MODULE_AUTHOR("Jean Delvare <[email protected]>");
 MODULE_DESCRIPTION("Intel 5500/5200/X58 chipset thermal sensor driver");
 MODULE_LICENSE("GPL");
-
-module_init(i5500_temp_init)
-module_exit(i5500_temp_exit)

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors