diff options
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r-- | drivers/core/device.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c index 2e5767ed99..4b3dcb3b37 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -772,6 +772,17 @@ int device_get_by_driver_info(const struct driver_info *info, 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; + struct udevice *dev; + + dev = drt->dev; + *devp = NULL; + + return device_get_device_tail(dev, dev ? 0 : -ENOENT, devp); +} #endif int device_find_first_child(const struct udevice *parent, struct udevice **devp) |