提交 a15d4cb3 编写于 作者: Y Yang Yingliang 提交者: Xie XiuQi

Revert "device: add device_shutdown_one() helper"

This reverts commit 565759fe2df8d553e8d8910e9d7f2032e9c9355c.
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 a0daeec9
...@@ -2854,40 +2854,6 @@ int device_move(struct device *dev, struct device *new_parent, ...@@ -2854,40 +2854,6 @@ int device_move(struct device *dev, struct device *new_parent,
} }
EXPORT_SYMBOL_GPL(device_move); EXPORT_SYMBOL_GPL(device_move);
static void device_shutdown_one(struct device *dev, struct device *parent)
{
/* hold lock to avoid race with probe/release */
if (parent)
device_lock(parent);
device_lock(dev);
/* Don't allow any more runtime suspends */
pm_runtime_get_noresume(dev);
pm_runtime_barrier(dev);
if (dev->class && dev->class->shutdown_pre) {
if (initcall_debug)
dev_info(dev, "shutdown_pre\n");
dev->class->shutdown_pre(dev);
}
if (dev->bus && dev->bus->shutdown) {
if (initcall_debug)
dev_info(dev, "shutdown\n");
dev->bus->shutdown(dev);
} else if (dev->driver && dev->driver->shutdown) {
if (initcall_debug)
dev_info(dev, "shutdown\n");
dev->driver->shutdown(dev);
}
device_unlock(dev);
if (parent)
device_unlock(parent);
put_device(dev);
put_device(parent);
}
/** /**
* device_shutdown - call ->shutdown() on each device to shutdown. * device_shutdown - call ->shutdown() on each device to shutdown.
*/ */
...@@ -2922,7 +2888,36 @@ void device_shutdown(void) ...@@ -2922,7 +2888,36 @@ void device_shutdown(void)
list_del_init(&dev->kobj.entry); list_del_init(&dev->kobj.entry);
spin_unlock(&devices_kset->list_lock); spin_unlock(&devices_kset->list_lock);
device_shutdown_one(dev, parent); /* hold lock to avoid race with probe/release */
if (parent)
device_lock(parent);
device_lock(dev);
/* Don't allow any more runtime suspends */
pm_runtime_get_noresume(dev);
pm_runtime_barrier(dev);
if (dev->class && dev->class->shutdown_pre) {
if (initcall_debug)
dev_info(dev, "shutdown_pre\n");
dev->class->shutdown_pre(dev);
}
if (dev->bus && dev->bus->shutdown) {
if (initcall_debug)
dev_info(dev, "shutdown\n");
dev->bus->shutdown(dev);
} else if (dev->driver && dev->driver->shutdown) {
if (initcall_debug)
dev_info(dev, "shutdown\n");
dev->driver->shutdown(dev);
}
device_unlock(dev);
if (parent)
device_unlock(parent);
put_device(dev);
put_device(parent);
spin_lock(&devices_kset->list_lock); spin_lock(&devices_kset->list_lock);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册