diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-10-16 02:45:26 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-10-16 02:45:26 -0700 |
| commit | f21c8fc316b1cf3c537656508fd463522d58cdf3 (patch) | |
| tree | f445005cc6bcfe7b789c7acccd4f07654126a1f1 | |
| parent | 007aa5530e2cbae97d4e149cfceeff730d4636bb (diff) | |
driver model: make sure we call device_unregister() and not put_device()
when removing system and platform devices.
| -rw-r--r-- | drivers/base/platform.c | 2 | ||||
| -rw-r--r-- | drivers/base/sys.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 29c90e34e67e..3856bc52b411 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -39,7 +39,7 @@ int platform_device_register(struct platform_device * pdev) void platform_device_unregister(struct platform_device * pdev) { if (pdev) - put_device(&pdev->dev); + device_unregister(&pdev->dev); } static int platform_match(struct device * dev, struct device_driver * drv) diff --git a/drivers/base/sys.c b/drivers/base/sys.c index a61fea973d36..cd681d1190bd 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -10,6 +10,8 @@ * add themselves as children of the system bus. */ +#define DEBUG 1 + #include <linux/device.h> #include <linux/module.h> #include <linux/kernel.h> @@ -76,8 +78,8 @@ int sys_register_root(struct sys_root * root) */ void sys_unegister_root(struct sys_root * root) { - put_device(&root->sysdev); - put_device(&root->dev); + device_unregister(&root->sysdev); + device_unregister(&root->dev); } /** @@ -125,7 +127,7 @@ int sys_device_register(struct sys_device * sysdev) void sys_device_unregister(struct sys_device * sysdev) { if (sysdev) - put_device(&sysdev->dev); + device_unregister(&sysdev->dev); } struct bus_type system_bus_type = { |
