diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-09 20:58:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-10 15:48:54 +0300 |
commit | a9efdd2519edd7df84afd075b65ca6428dcb0039 (patch) | |
tree | 133d2181c5829af2d720998b4cfebf8cce6b0497 /drivers/base | |
parent | 8afbb4273977f055db219a22daaafe64be10fb95 (diff) | |
download | linux-a9efdd2519edd7df84afd075b65ca6428dcb0039.tar.xz |
driver core: remove subsys_find_device_by_id()
This function has not been called by any code in the kernel tree in many
many years so remove it as it is unused.
Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20230109175810.2965448-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/bus.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 4425f962bf51..f8eb882bbf37 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -339,47 +339,6 @@ struct device *bus_find_device(struct bus_type *bus, } EXPORT_SYMBOL_GPL(bus_find_device); -/** - * subsys_find_device_by_id - find a device with a specific enumeration number - * @subsys: subsystem - * @id: index 'id' in struct device - * @hint: device to check first - * - * Check the hint's next object and if it is a match return it directly, - * otherwise, fall back to a full list search. Either way a reference for - * the returned object is taken. - */ -struct device *subsys_find_device_by_id(struct bus_type *subsys, unsigned int id, - struct device *hint) -{ - struct klist_iter i; - struct device *dev; - - if (!subsys) - return NULL; - - if (hint) { - klist_iter_init_node(&subsys->p->klist_devices, &i, &hint->p->knode_bus); - dev = next_device(&i); - if (dev && dev->id == id && get_device(dev)) { - klist_iter_exit(&i); - return dev; - } - klist_iter_exit(&i); - } - - klist_iter_init_node(&subsys->p->klist_devices, &i, NULL); - while ((dev = next_device(&i))) { - if (dev->id == id && get_device(dev)) { - klist_iter_exit(&i); - return dev; - } - } - klist_iter_exit(&i); - return NULL; -} -EXPORT_SYMBOL_GPL(subsys_find_device_by_id); - static struct device_driver *next_driver(struct klist_iter *i) { struct klist_node *n = klist_next(i); |