diff options
| author | Patrick Mochel <mochel@osdl.org> | 2003-06-11 01:42:06 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2003-06-11 01:42:06 -0700 |
| commit | 8861b6ce54452a554914445e60f3af8a509124e4 (patch) | |
| tree | f17dd62ed09b4b430e960e020bc2ce2d00d9f7c6 /include/linux/sysdev.h | |
| parent | 1a90740a153a4e8b682425d611037cb369f2847a (diff) | |
[driver model] Make sure system device drivers are added if registered late.
From Jeremy Fitzhardinge:
With the current system device changes (I picked them up in 2.5.70-mm8),
the system device class assumes that all system device drivers are
registered before any system devices are registered.
Unfortunately, this is often not the case. CPU devices are registered
very early, but cpufreq registers drivers for them; since cpufreq
drivers can be loaded as modules, they clearly can't be registered
before the device is.
This patch keeps a list of all registered devices hanging off the system
device class. When a new driver is registered, it calls the driver's
add() function with all existing devices.
Conversely, when a driver is unregistered, it calls the driver's
remove() function for all existing devices so the driver can clean up.
Note: the list in the class's embedded kset is used, rather than creating
a new field.
Diffstat (limited to 'include/linux/sysdev.h')
| -rw-r--r-- | include/linux/sysdev.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index 4bc3e22b5104..614200d60389 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h @@ -72,6 +72,7 @@ struct sys_device { u32 id; struct sysdev_class * cls; struct kobject kobj; + struct list_head entry; }; extern int sys_device_register(struct sys_device *); |
