[PATCH v2 14/37] dm: core: Drop device_get_by_driver_info()
Simon Glass
sjg at chromium.org
Wed Feb 3 17:43:30 CET 2021
This function is now only used in a test. Drop it.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
(no changes since v1)
drivers/core/device.c | 15 ---------------
include/dm/device.h | 15 ---------------
test/dm/of_platdata.c | 7 ++-----
3 files changed, 2 insertions(+), 35 deletions(-)
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 02e28f014b5..51516391d16 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -753,21 +753,6 @@ int device_get_global_by_ofnode(ofnode ofnode, struct udevice **devp)
}
#if CONFIG_IS_ENABLED(OF_PLATDATA)
-int device_get_by_driver_info(const struct driver_info *info,
- struct udevice **devp)
-{
- struct driver_info *info_base =
- ll_entry_start(struct driver_info, driver_info);
- int idx = info - info_base;
- struct driver_rt *drt = gd_dm_driver_rt() + idx;
- struct udevice *dev;
-
- dev = drt->dev;
- *devp = NULL;
-
- return device_get_device_tail(dev, dev ? 0 : -ENOENT, devp);
-}
-
int device_get_by_driver_info_idx(uint idx, struct udevice **devp)
{
struct driver_rt *drt = gd_dm_driver_rt() + idx;
diff --git a/include/dm/device.h b/include/dm/device.h
index 38ef47baa01..c9afa4dce50 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -631,21 +631,6 @@ int device_find_global_by_ofnode(ofnode node, struct udevice **devp);
*/
int device_get_global_by_ofnode(ofnode node, struct udevice **devp);
-/**
- * device_get_by_driver_info() - Get a device based on driver_info
- *
- * Locates a device by its struct driver_info, by using its reference which
- * is updated during the bind process.
- *
- * The device is probed to activate it ready for use.
- *
- * @info: Struct driver_info
- * @devp: Returns pointer to device if found, otherwise this is set to NULL
- * @return 0 if OK, -ve on error
- */
-int device_get_by_driver_info(const struct driver_info *info,
- struct udevice **devp);
-
/**
* device_get_by_driver_info_idx() - Get a device based on driver_info index
*
diff --git a/test/dm/of_platdata.c b/test/dm/of_platdata.c
index f93a75b4481..0de4ab5dafa 100644
--- a/test/dm/of_platdata.c
+++ b/test/dm/of_platdata.c
@@ -141,8 +141,6 @@ static int find_driver_info(struct unit_test_state *uts, struct udevice *parent,
/* Check that every device is recorded in its driver_info struct */
static int dm_test_of_plat_dev(struct unit_test_state *uts)
{
- const struct driver_info *info =
- ll_entry_start(struct driver_info, driver_info);
const int n_ents = ll_entry_count(struct driver_info, driver_info);
bool found[n_ents];
uint i;
@@ -154,18 +152,17 @@ static int dm_test_of_plat_dev(struct unit_test_state *uts)
/* Make sure that the driver entries without devices have no ->dev */
for (i = 0; i < n_ents; i++) {
const struct driver_rt *drt = gd_dm_driver_rt() + i;
- const struct driver_info *entry = info + i;
struct udevice *dev;
if (found[i]) {
/* Make sure we can find it */
ut_assertnonnull(drt->dev);
- ut_assertok(device_get_by_driver_info(entry, &dev));
+ ut_assertok(device_get_by_driver_info_idx(i, &dev));
ut_asserteq_ptr(dev, drt->dev);
} else {
ut_assertnull(drt->dev);
ut_asserteq(-ENOENT,
- device_get_by_driver_info(entry, &dev));
+ device_get_by_driver_info_idx(i, &dev));
}
}
--
2.30.0.365.g02bc693789-goog
More information about the U-Boot
mailing list