]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/sata.c
scsi: move the partition initialization out of the scsi detection
[people/ms/u-boot.git] / common / sata.c
index 88f08c95eca46249143b3898189bcfc846cfc0e6..42ff5c7755a64d466965c81b75632a88fdb6f0f9 100644 (file)
@@ -51,7 +51,7 @@ static unsigned long sata_bwrite(struct blk_desc *block_dev, lbaint_t start,
 
 int __sata_initialize(void)
 {
-       int rc;
+       int rc, ret = -1;
        int i;
 
        for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) {
@@ -71,12 +71,14 @@ int __sata_initialize(void)
                if (!rc) {
                        rc = scan_sata(i);
                        if (!rc && sata_dev_desc[i].lba > 0 &&
-                           sata_dev_desc[i].blksz > 0)
+                           sata_dev_desc[i].blksz > 0) {
                                part_init(&sata_dev_desc[i]);
+                               ret = i;
+                       }
                }
        }
 
-       return rc;
+       return ret;
 }
 int sata_initialize(void) __attribute__((weak, alias("__sata_initialize")));