diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2015-08-27 03:44:28 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-08-31 13:57:29 (GMT) |
commit | e6cabe4a6d142ab981bd31bff0795ed230caf151 (patch) | |
tree | b06fc2afa6bf4c2e43b0fda2aaf776dec5a3472a /drivers/core/device.c | |
parent | f6ac9f1f666a291358f8a402a3d49217ddaef80d (diff) | |
download | u-boot-e6cabe4a6d142ab981bd31bff0795ed230caf151.tar.xz |
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/device.c')
-rw-r--r-- | drivers/core/device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c index 01f6647..afa4b4f 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; |