summaryrefslogtreecommitdiffstats
path: root/drivers/core
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-08-27 12:44:28 +0900
committerSimon Glass <sjg@chromium.org>2015-08-31 07:57:29 -0600
commite6cabe4a6d142ab981bd31bff0795ed230caf151 (patch)
treeb06fc2afa6bf4c2e43b0fda2aaf776dec5a3472a /drivers/core
parentf6ac9f1f666a291358f8a402a3d49217ddaef80d (diff)
downloadtalos-obmc-uboot-e6cabe4a6d142ab981bd31bff0795ed230caf151.tar.gz
talos-obmc-uboot-e6cabe4a6d142ab981bd31bff0795ed230caf151.zip
dm: core: allow device_bind() to not return a device pointer
This is useful when we want to bind a device, but do not need the pointer to the device. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 01f664796d..afa4b4fda9 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -32,7 +32,8 @@ int device_bind(struct udevice *parent, const struct driver *drv,
struct uclass *uc;
int size, ret = 0;
- *devp = NULL;
+ if (devp)
+ *devp = NULL;
if (!name)
return -EINVAL;
@@ -133,7 +134,8 @@ int device_bind(struct udevice *parent, const struct driver *drv,
if (parent)
dm_dbg("Bound device %s to %s\n", dev->name, parent->name);
- *devp = dev;
+ if (devp)
+ *devp = dev;
dev->flags |= DM_FLAG_BOUND;
OpenPOWER on IntegriCloud