summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8813986)
raw | patch | inline | side by side (parent: 8813986)
author | Simon Glass <sjg@chromium.org> | |
Mon, 15 Mar 2021 04:25:25 +0000 (17:25 +1300) | ||
committer | Simon Glass <sjg@chromium.org> | |
Fri, 26 Mar 2021 04:03:08 +0000 (17:03 +1300) |
This function is now only used in a test. Drop it. Also drop
DM_DRVINFO_GET() which was the only purpose for having the function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
DM_DRVINFO_GET() which was the only purpose for having the function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/core/device.c | patch | blob | history | |
include/dm/device.h | patch | blob | history | |
include/dm/platdata.h | patch | blob | history | |
test/dm/of_platdata.c | patch | blob | history |
diff --git a/drivers/core/device.c b/drivers/core/device.c
index e915b3089dee39e50eb19723f2bed431543060b3..2399f6f70cec75cee1896be92a742938a65bf433 100644 (file)
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
}
#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 5b8f27d455bef81c4ee2d8263f35b9d077ae5ed8..ca796059e0c8aaa0234baa0903fcc3908a1f9cf5 100644 (file)
--- a/include/dm/device.h
+++ b/include/dm/device.h
*/
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/include/dm/platdata.h b/include/dm/platdata.h
index 3821a56f2ca145f620056afd553ee55be9e1346a..4efb1dfe12d2c1e5b8548e9ecd5050ee2ee24939 100644 (file)
--- a/include/dm/platdata.h
+++ b/include/dm/platdata.h
#define U_BOOT_DRVINFOS(__name) \
ll_entry_declare_list(struct driver_info, __name, driver_info)
-/**
- * Get a pointer to a given device info given its name
- *
- * With the declaration U_BOOT_DRVINFO(name), DM_DRVINFO_GET(name) will return a
- * pointer to the struct driver_info created by that declaration.
- *
- * if OF_PLATDATA is enabled, from this it is possible to use the @dev member of
- * struct driver_info to find the device pointer itself.
- *
- * @__name: Driver name (C identifier, not a string. E.g. gpio7_at_ff7e0000)
- * @return struct driver_info * to the driver that created the device
- */
-#define DM_DRVINFO_GET(__name) \
- ll_entry_get(struct driver_info, __name, driver_info)
-
#endif
diff --git a/test/dm/of_platdata.c b/test/dm/of_platdata.c
index 93ad5727255f772be65c5089283dd93435cb1cc6..d68c59128289371c5a75718639ceff504566edd3 100644 (file)
--- a/test/dm/of_platdata.c
+++ b/test/dm/of_platdata.c
@@ -142,8 +142,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;
/* 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));
}
}