git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
base
/
power
/
shutdown.c
diff --git
a/drivers/base/power/shutdown.c
b/drivers/base/power/shutdown.c
index
f50a08b
..
8826a5b
100644
(file)
--- a/
drivers/base/power/shutdown.c
+++ b/
drivers/base/power/shutdown.c
@@
-12,6
+12,7
@@
#include <linux/device.h>
#include <asm/semaphore.h>
#include <linux/device.h>
#include <asm/semaphore.h>
+#include "../base.h"
#include "power.h"
#define to_dev(node) container_of(node, struct device, kobj.entry)
#include "power.h"
#define to_dev(node) container_of(node, struct device, kobj.entry)
@@
-28,19
+29,21
@@
extern struct subsystem devices_subsys;
* they only get one called once when interrupts are disabled.
*/
* they only get one called once when interrupts are disabled.
*/
-extern int sysdev_shutdown(void);
/**
* device_shutdown - call ->shutdown() on each device to shutdown.
*/
void device_shutdown(void)
{
/**
* device_shutdown - call ->shutdown() on each device to shutdown.
*/
void device_shutdown(void)
{
- struct device * dev;
+ struct device * dev
, *devn
;
down_write(&devices_subsys.rwsem);
down_write(&devices_subsys.rwsem);
- list_for_each_entry_
reverse(dev
, &devices_subsys.kset.list,
+ list_for_each_entry_
safe_reverse(dev, devn
, &devices_subsys.kset.list,
kobj.entry) {
kobj.entry) {
- if (dev->driver && dev->driver->shutdown) {
+ if (dev->bus && dev->bus->shutdown) {
+ dev_dbg(dev, "shutdown\n");
+ dev->bus->shutdown(dev);
+ } else if (dev->driver && dev->driver->shutdown) {
dev_dbg(dev, "shutdown\n");
dev->driver->shutdown(dev);
}
dev_dbg(dev, "shutdown\n");
dev->driver->shutdown(dev);
}