]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - disk/part.c
disk: default to HW partition 0 if not specified
[karo-tx-uboot.git] / disk / part.c
index 2827089d8d5f74eeb0d0a6b12863bf30e110f63e..b3097e32f0eb0a14bb356f21d816abb39e78ca72 100644 (file)
@@ -86,7 +86,7 @@ block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
                        block_dev_desc_t *dev_desc = reloc_get_dev(dev);
                        if (!dev_desc)
                                return NULL;
-                       if (hwpart == -1)
+                       if (hwpart == 0 && !select_hwpart)
                                return dev_desc;
                        if (!select_hwpart)
                                return NULL;
@@ -102,7 +102,7 @@ block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
 
 block_dev_desc_t *get_dev(const char *ifname, int dev)
 {
-       return get_dev_hwpart(ifname, dev, -1);
+       return get_dev_hwpart(ifname, dev, 0);
 }
 #else
 block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
@@ -460,7 +460,7 @@ int get_device(const char *ifname, const char *dev_hwpart_str,
                hwpart_str++;
        } else {
                dev_str = dev_hwpart_str;
-               hwpart = -1;
+               hwpart = 0;
        }
 
        dev = simple_strtoul(dev_str, &ep, 16);