From a0daeec97f765f3b379739ae3932ac48bcc53d5f Mon Sep 17 00:00:00 2001 From: Yang Yingliang Date: Mon, 14 Jan 2019 16:36:12 +0800 Subject: [PATCH] Revert "device: add device_shutdown_by_driver() helper" This reverts commit 3cbd5bf6892f0c8c6a12d5848af1e1b46ec50eef. Signed-off-by: Yang Yingliang --- drivers/base/core.c | 30 ------------------------------ include/linux/device.h | 1 - 2 files changed, 31 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index b5f8b5a26ab0..60833f94f785 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2929,36 +2929,6 @@ void device_shutdown(void) spin_unlock(&devices_kset->list_lock); } -void device_shutdown_by_driver(char *drv_name) -{ - struct device *dev, *parent, *next; - int len = 0; - - if (!drv_name) - return; - - len = strlen(drv_name); - if (!len) - return; - - wait_for_device_probe(); - device_block_probing(); - - spin_lock(&devices_kset->list_lock); - list_for_each_entry_safe(dev, next, &devices_kset->list, kobj.entry) { - if (dev->driver && len == strlen(dev->driver->name) && - !strncmp(dev->driver->name, drv_name, len)) { - parent = get_device(dev->parent); - get_device(dev); - list_del(&dev->kobj.entry); - spin_unlock(&devices_kset->list_lock); - device_shutdown_one(dev, parent); - spin_lock(&devices_kset->list_lock); - } - } - spin_unlock(&devices_kset->list_lock); -} - /* * Device logging functions */ diff --git a/include/linux/device.h b/include/linux/device.h index b397ca8c3cae..8f882549edee 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1321,7 +1321,6 @@ static inline int devtmpfs_mount(const char *mountpoint) { return 0; } /* drivers/base/power/shutdown.c */ extern void device_shutdown(void); -extern void device_shutdown_by_driver(char *drv_name); /* debugging and troubleshooting/diagnostic helpers. */ extern const char *dev_driver_string(const struct device *dev); -- GitLab