|
@@ -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")));
|
|
|
|