Skip to contentSkip to conversation

hwmon should subsys_init

PATCH New David Brownell 2 participants 2 messages Dec 21, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon should subsys_init

Subsystem infrastructure should normally register with "subsys_initcall", so that it's available to drivers that may need to initialize early.

This patch updates "hwmon" to do so. It's common for embedded systems to have multifunction chips with hardware monitoring interfaces, and to have those chips be used during system bringup ... before a normal "module_init" would kick, or maybe just linked so they'd init before hwmon.

Signed-off-by David Brownell <dbrownell at users.sourceforge.net>

Index: at91/drivers/hwmon/hwmon.c
=================================--- at91.orig/drivers/hwmon/hwmon.c 2006-04-06 18:30:25.000000000 -0700
+++ at91/drivers/hwmon/hwmon.c 2006-12-21 03:16:13.000000000 -0800
@@ -101,7 +101,7 @@ static void __exit hwmon_exit(void)
class_destroy(hwmon_class);
}

-module_init(hwmon_init);
+subsys_initcall(hwmon_init);
module_exit(hwmon_exit);

EXPORT_SYMBOL_GPL(hwmon_device_register);

Applied
#1 lore raw

PATCH 1/1 hwmon should subsys_init

Quoted 14 lines · David Brownell

Subsystem infrastructure should normally register with "subsys_initcall", so that it's available to drivers that may need to initialize early.

This patch updates "hwmon" to do so. It's common for embedded systems to have multifunction chips with hardware monitoring interfaces, and to have those chips be used during system bringup ... before a normal "module_init" would kick, or maybe just linked so they'd init before hwmon.

Signed-off-by David Brownell <dbrownell at users.sourceforge.net>

Index: at91/drivers/hwmon/hwmon.c
=================================> --- at91.orig/drivers/hwmon/hwmon.c 2006-04-06 18:30:25.000000000 -0700
+++ at91/drivers/hwmon/hwmon.c 2006-12-21 03:16:13.000000000 -0800

Review static void __exit hwmon_exit(void) · line 107

Quoted 8 lines
(quoted diff) +1 -1
@@ -101,7 +101,7 @@ static void __exit hwmon_exit(void)
 	class_destroy(hwmon_class);
 }
 
-module_init(hwmon_init);
+subsys_initcall(hwmon_init);
 module_exit(hwmon_exit);
 
 EXPORT_SYMBOL_GPL(hwmon_device_register);

Applied, thanks.

Signature · 1 line
Jean Delvare