summaryrefslogtreecommitdiffstats
path: root/drivers/core
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-05-17 13:58:27 -0400
committerTom Rini <trini@konsulko.com>2016-05-17 13:58:27 -0400
commit4b6e1fda107e5244e80ebc41865650ac2873dc88 (patch)
treef448089740af77c2987d12e2dd5b753b7659586f /drivers/core
parent27bec5c12757c80f598b704477c1bc6c250bcb4c (diff)
parent341392dd115f1385c31bb0b034ec15f542730e30 (diff)
downloadtalos-obmc-uboot-4b6e1fda107e5244e80ebc41865650ac2873dc88.tar.gz
talos-obmc-uboot-4b6e1fda107e5244e80ebc41865650ac2873dc88.zip
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/device-remove.c2
-rw-r--r--drivers/core/device.c10
-rw-r--r--drivers/core/lists.c4
3 files changed, 14 insertions, 2 deletions
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index e1714b2202..0e56b23fbb 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -112,6 +112,8 @@ int device_unbind(struct udevice *dev)
devres_release_all(dev);
+ if (dev->flags & DM_NAME_ALLOCED)
+ free((char *)dev->name);
free(dev);
return 0;
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 1322991d6c..5c2dc7021f 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -657,8 +657,8 @@ fdt_addr_t dev_get_addr_name(struct udevice *dev, const char *name)
#if CONFIG_IS_ENABLED(OF_CONTROL)
int index;
- index = fdt_find_string(gd->fdt_blob, dev->parent->of_offset,
- "reg-names", name);
+ index = fdt_find_string(gd->fdt_blob, dev->of_offset, "reg-names",
+ name);
if (index < 0)
return index;
@@ -706,12 +706,18 @@ bool device_is_last_sibling(struct udevice *dev)
return list_is_last(&dev->sibling_node, &parent->child_head);
}
+void device_set_name_alloced(struct udevice *dev)
+{
+ dev->flags |= DM_NAME_ALLOCED;
+}
+
int device_set_name(struct udevice *dev, const char *name)
{
name = strdup(name);
if (!name)
return -ENOMEM;
dev->name = name;
+ device_set_name_alloced(dev);
return 0;
}
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index c4fc216340..a72db13a11 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -171,6 +171,10 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset,
dm_dbg(" - found match at '%s'\n", entry->name);
ret = device_bind(parent, entry, name, NULL, offset, &dev);
+ if (ret == -ENODEV) {
+ dm_dbg("Driver '%s' refuses to bind\n", entry->name);
+ continue;
+ }
if (ret) {
dm_warn("Error binding driver '%s': %d\n", entry->name,
ret);
OpenPOWER on IntegriCloud