]> git.sur5r.net Git - u-boot/blobdiff - api/api_storage.c
Cosmetic api: api_storage.c Align parenthesis
[u-boot] / api / api_storage.c
index 8c30c56e497a1ddf74c2510f7a5eec7c92cccd29..81c672d424be34453938d5e0ffa2816313c0bab7 100644 (file)
@@ -41,7 +41,7 @@ struct stor_spec {
        char            *name;
 };
 
-static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, "" }, };
+static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, NULL }, };
 
 
 void dev_stor_init(void)
@@ -67,7 +67,7 @@ void dev_stor_init(void)
        specs[ENUM_SATA].type = DEV_TYP_STOR | DT_STOR_SATA;
        specs[ENUM_SATA].name = "sata";
 #endif
-#if defined(CONFIG_CMD_SCSI)
+#if defined(CONFIG_SCSI)
        specs[ENUM_SCSI].max_dev = CONFIG_SYS_SCSI_MAX_DEVICE;
        specs[ENUM_SCSI].enum_started = 0;
        specs[ENUM_SCSI].enum_ended = 0;
@@ -105,6 +105,10 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
 
        struct blk_desc *dd;
 
+       /* Wasn't configured for this type, return 0 directly */
+       if (specs[type].name == NULL)
+               return 0;
+
        if (first) {
                di->cookie = (void *)blk_get_dev(specs[type].name, 0);
                if (di->cookie == NULL)
@@ -278,7 +282,7 @@ static int dev_enum_stor(int type, struct device_info *di)
 
        if (found)
                debugf("device found, returning cookie 0x%08x\n",
-                       (u_int32_t)di->cookie);
+                      (u_int32_t)di->cookie);
        else
                debugf("no device found\n");