diff options
author | Tom Rini <trini@konsulko.com> | 2015-04-28 19:37:20 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-04-28 19:37:20 -0400 |
commit | 4842c58990ac065c2d33b71e1a7fde48f336dac2 (patch) | |
tree | 1f5a23f891c820526f54b0b214b4628fae7f6c59 /drivers/core | |
parent | e536ab8849b2b4f6d68bbc8e1d1f9bc033db06bd (diff) | |
parent | f66529f998e59acbd64ccce3adfce8eedfa52da8 (diff) |
Merge branch 'master' of git://www.denx.de/git/u-boot-dm
Diffstat (limited to 'drivers/core')
-rw-r--r-- | drivers/core/device.c | 6 | ||||
-rw-r--r-- | drivers/core/uclass.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c index 3b77d231d34..85fd1fc7350 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -135,7 +135,7 @@ int device_bind(struct udevice *parent, const struct driver *drv, return 0; fail_child_post_bind: - if (IS_ENABLED(DM_DEVICE_REMOVE)) { + if (IS_ENABLED(CONFIG_DM_DEVICE_REMOVE)) { if (drv->unbind && drv->unbind(dev)) { dm_warn("unbind() method failed on dev '%s' on error path\n", dev->name); @@ -143,14 +143,14 @@ fail_child_post_bind: } fail_bind: - if (IS_ENABLED(DM_DEVICE_REMOVE)) { + if (IS_ENABLED(CONFIG_DM_DEVICE_REMOVE)) { if (uclass_unbind_device(dev)) { dm_warn("Failed to unbind dev '%s' on error path\n", dev->name); } } fail_uclass_bind: - if (IS_ENABLED(DM_DEVICE_REMOVE)) { + if (IS_ENABLED(CONFIG_DM_DEVICE_REMOVE)) { list_del(&dev->sibling_node); if (dev->flags & DM_FLAG_ALLOC_PARENT_PDATA) { free(dev->parent_platdata); diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 04e939d6c13..7de817324b9 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -277,6 +277,7 @@ int uclass_get_device_tail(struct udevice *dev, int ret, if (ret) return ret; + assert(dev); ret = device_probe(dev); if (ret) return ret; @@ -342,6 +343,8 @@ int uclass_first_device(enum uclass_id id, struct udevice **devp) *devp = NULL; ret = uclass_find_first_device(id, &dev); + if (!dev) + return 0; return uclass_get_device_tail(dev, ret, devp); } @@ -352,6 +355,8 @@ int uclass_next_device(struct udevice **devp) *devp = NULL; ret = uclass_find_next_device(&dev); + if (!dev) + return 0; return uclass_get_device_tail(dev, ret, devp); } |