Convert CONFIG_SYS_SPL_MALLOC_SIZE et al to Kconfig
[platform/kernel/u-boot.git] / common / usb_storage.c
index 5d6f704..eaa3137 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <common.h>
 #include <blk.h>
+#include <bootdev.h>
 #include <command.h>
 #include <dm.h>
 #include <errno.h>
@@ -94,7 +95,7 @@ struct us_data {
        int             action;                 /* what to do */
        int             ip_wanted;              /* needed */
        int             *irq_handle;            /* for USB int requests */
-       unsigned int    irqpipe;                /* pipe for release_irq */
+       unsigned int    irqpipe;                /* pipe for release_irq */
        unsigned char   irqmaxp;                /* max packed for irq Pipe */
        unsigned char   irqinterval;            /* Intervall for IRQ Pipe */
        struct scsi_cmd *srb;                   /* current srb */
@@ -239,6 +240,20 @@ static int usb_stor_probe_device(struct usb_device *udev)
                        if (ret)
                                return ret;
                }
+
+               ret = blk_probe_or_unbind(dev);
+               if (ret)
+                       return ret;
+
+               ret = bootdev_setup_sibling_blk(dev, "usb_bootdev");
+               if (ret) {
+                       int ret2;
+
+                       ret2 = device_unbind(dev);
+                       if (ret2)
+                               return log_msg_ret("bootdev", ret2);
+                       return log_msg_ret("bootdev", ret);
+               }
        }
 #else
        /* We don't have space to even probe if we hit the maximum */
@@ -431,8 +446,8 @@ static int us_one_transfer(struct us_data *us, int pipe, char *buf, int length)
                                        return 0;
                                }
                                /* if our try counter reaches 0, bail out */
-                                       debug(" %ld, data %d\n",
-                                             us->pusb_dev->status, partial);
+                               debug(" %ld, data %d\n",
+                                     us->pusb_dev->status, partial);
                                if (!maxtry--)
                                                return result;
                        }