]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/core/device.c
dm: core: allow device_bind() to not return a device pointer
[karo-tx-uboot.git] / drivers / core / device.c
index 01f664796d82e5df72ff993d0de78204e6e6eded..afa4b4fda97809e72f0e671fa6f9307a3a92e88d 100644 (file)
@@ -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;