]> git.sur5r.net Git - u-boot/blobdiff - drivers/core/device.c
microblaze: Remove CONSOLE_ARG
[u-boot] / drivers / core / device.c
index 8c6e6b067e70eb5c6f457d8eb71f5a79f2d11a06..f5def35b5b67c9a9d279b3e7de4c588c0a5a7b94 100644 (file)
@@ -64,7 +64,7 @@ int device_bind(struct udevice *parent, const struct driver *drv,
 
        dev->seq = -1;
        dev->req_seq = -1;
-       if (CONFIG_IS_ENABLED(OF_CONTROL) && IS_ENABLED(CONFIG_DM_SEQ_ALIAS)) {
+       if (CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(DM_SEQ_ALIAS)) {
                /*
                * Some devices, such as a SPI bus, I2C bus and serial ports
                * are numbered using aliases.
@@ -135,6 +135,11 @@ int device_bind(struct udevice *parent, const struct driver *drv,
                if (ret)
                        goto fail_child_post_bind;
        }
+       if (uc->uc_drv->post_bind) {
+               ret = uc->uc_drv->post_bind(dev);
+               if (ret)
+                       goto fail_uclass_post_bind;
+       }
 
        if (parent)
                dm_dbg("Bound device %s to %s\n", dev->name, parent->name);
@@ -145,6 +150,8 @@ int device_bind(struct udevice *parent, const struct driver *drv,
 
        return 0;
 
+fail_uclass_post_bind:
+       /* There is no child unbind() method, so no clean-up required */
 fail_child_post_bind:
        if (CONFIG_IS_ENABLED(DM_DEVICE_REMOVE)) {
                if (drv->unbind && drv->unbind(dev)) {
@@ -292,9 +299,11 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
 
        /*
         * Process pinctrl for everything except the root device, and
-        * continue regardless of the result of pinctrl.
+        * continue regardless of the result of pinctrl. Don't process pinctrl
+        * settings for pinctrl devices since the device may not yet be
+        * probed.
         */
-       if (dev->parent)
+       if (dev->parent && device_get_uclass_id(dev) != UCLASS_PINCTRL)
                pinctrl_select_state(dev, "default");
 
        ret = uclass_pre_probe_device(dev);