summaryrefslogtreecommitdiff
path: root/drivers/core/uclass.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-07-11 20:28:46 -0400
committerTom Rini <trini@konsulko.com>2017-07-11 20:28:46 -0400
commit8d3a25685e4aac7070365a2b3c53c2c81b27930f (patch)
tree7956bf5e00e3490169a7fc41c42a4416da8db51f /drivers/core/uclass.c
parentd43ef73bf26614af9b01fd57baa1a1fcf24bfade (diff)
parent8c9eaadaaad888e0cd77512553d0d02d476b4dde (diff)
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'drivers/core/uclass.c')
-rw-r--r--drivers/core/uclass.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 21dc696da3..f5e4067922 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -366,8 +366,7 @@ int uclass_get_device_by_driver(enum uclass_id id,
return -ENODEV;
}
-int uclass_get_device_tail(struct udevice *dev, int ret,
- struct udevice **devp)
+int uclass_get_device_tail(struct udevice *dev, int ret, struct udevice **devp)
{
if (ret)
return ret;
@@ -493,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;