Skip to contentSkip to conversation

hwmon should use subsys_init

PATCH New David Brownell 2 participants 3 messages Feb 16, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon should use subsys_init

The hwmon subsystem registers itself excessively late when it's not linked as a module. That can cause problems when multifunction chips, that happen to have hwmon capabilities and live outside the hwmon subdirectory, need to initialize earlier than on various platforms.

This patch makes the hwmon subsystem code register itself appropriately early:
as a subsystem, like other subsystems.

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

Index: osk/drivers/hwmon/hwmon.c
=================================--- osk.orig/drivers/hwmon/hwmon.c 2006-05-02 19:18:31.000000000 -0700
+++ osk/drivers/hwmon/hwmon.c 2006-05-02 19:18:46.000000000 -0700
@@ -102,7 +102,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);

#1 lore raw

PATCH 1/1 hwmon should use subsys_init

Hi David,

Quoted 7 lines · David Brownell

The hwmon subsystem registers itself excessively late when it's not linked as a module. That can cause problems when multifunction chips, that happen to have hwmon capabilities and live outside the hwmon subdirectory, need to initialize earlier than on various platforms.

This patch makes the hwmon subsystem code register itself appropriately early:
as a subsystem, like other subsystems.

This patch is already in my tree and planned for inclusion in kernel 2.6.21. I asked Linus to pull the hwmon updates (including this one) from my tree two days ago but he did not yet. I'll ask him again tomorrow if needed.

Thanks,

Signature · 1 line
Jean Delvare
#2 lore raw

PATCH 1/1 hwmon should use subsys_init

In reply to David Brownell
Quoted 5 lines
Quoted 2 lines

This patch makes the hwmon subsystem code register itself appropriately early:
as a subsystem, like other subsystems.

This patch is already in my tree and planned for inclusion in kernel 2.6.21.

OK ... I thought I'd already sent that along, but didn't have a note that I'd done so.

Quoted 3 lines

I asked Linus to pull the hwmon updates (including this one)
from my tree two days ago but he did not yet. I'll ask him again tomorrow if needed.

He has to pull ARM patches too. Right now ARM can't build, so I can't test the latest I2C stuff ... ;)

- Dave