summaryrefslogtreecommitdiff
path: root/common/sata.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/sata.c')
-rw-r--r--common/sata.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/sata.c b/common/sata.c
index 88f08c9..42ff5c7 100644
--- a/common/sata.c
+++ b/common/sata.c
@@ -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")));