diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/core/uclass.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 97500f4108..f5e4067922 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -492,6 +492,33 @@ int uclass_next_device(struct udevice **devp) return uclass_get_device_tail(dev, ret, devp); } +int uclass_first_device_check(enum uclass_id id, struct udevice **devp) +{ + int ret; + + *devp = NULL; + ret = uclass_find_first_device(id, devp); + if (ret) + return ret; + if (!*devp) + return 0; + + return device_probe(*devp); +} + +int uclass_next_device_check(struct udevice **devp) +{ + int ret; + + ret = uclass_find_next_device(devp); + if (ret) + return ret; + if (!*devp) + return 0; + + return device_probe(*devp); +} + int uclass_bind_device(struct udevice *dev) { struct uclass *uc; |