From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: [PATCH 2/6] driver core: remove subsys_find_device_by_id()
Date: Mon, 9 Jan 2023 18:58:06 +0100 [thread overview]
Message-ID: <20230109175810.2965448-2-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20230109175810.2965448-1-gregkh@linuxfoundation.org>
This function has not been called by any code in the kernel tree in many
many years so remove it as it is unused.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/bus.c | 41 --------------------------------------
include/linux/device/bus.h | 2 --
2 files changed, 43 deletions(-)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 4e6fdb65a157..45aa8d996f0a 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -363,47 +363,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);
diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h
index 0699b3970344..d865440d8c02 100644
--- a/include/linux/device/bus.h
+++ b/include/linux/device/bus.h
@@ -250,8 +250,6 @@ bus_find_device_by_acpi_dev(struct bus_type *bus, const void *adev)
}
#endif
-struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
- struct device *hint);
int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
void *data, int (*fn)(struct device_driver *, void *));
void bus_sort_breadthfirst(struct bus_type *bus,
--
2.39.0
next prev parent reply other threads:[~2023-01-09 18:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 17:58 [PATCH 1/6] driver core: make bus_get_device_klist() static Greg Kroah-Hartman
2023-01-09 17:58 ` Greg Kroah-Hartman [this message]
2023-01-10 12:34 ` [PATCH 2/6] driver core: remove subsys_find_device_by_id() Rafael J. Wysocki
2023-01-09 17:58 ` [PATCH 3/6] driver core: make subsys_dev_iter_init() static Greg Kroah-Hartman
2023-01-10 12:35 ` Rafael J. Wysocki
2023-01-09 17:58 ` [PATCH 4/6] driver core: make subsys_dev_iter_next() static Greg Kroah-Hartman
2023-01-10 12:35 ` Rafael J. Wysocki
2023-01-09 17:58 ` [PATCH 5/6] driver core: make subsys_dev_iter_exit() static Greg Kroah-Hartman
2023-01-10 12:36 ` Rafael J. Wysocki
2023-01-09 17:58 ` [PATCH 6/6] driver core: move struct subsys_dev_iter to a local file Greg Kroah-Hartman
2023-01-10 12:37 ` Rafael J. Wysocki
2023-01-10 12:33 ` [PATCH 1/6] driver core: make bus_get_device_klist() static Rafael J. Wysocki
2023-01-10 12:43 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230109175810.2965448-2-gregkh@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox