summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-10-08 07:45:54 +0000
committerTom Rini <trini@ti.com>2012-10-17 07:59:09 -0700
commit71bba424adcfa8c44100dee0fd139cc057eace65 (patch)
tree1f0088c14448eec8312c32ef34a702023c6875b5
parent8af4472a775e5719127cd109cd5e7f2bde470131 (diff)
downloadu-boot-imx-71bba424adcfa8c44100dee0fd139cc057eace65.zip
u-boot-imx-71bba424adcfa8c44100dee0fd139cc057eace65.tar.gz
u-boot-imx-71bba424adcfa8c44100dee0fd139cc057eace65.tar.bz2
disk: get_device_and_partition() return value fixes
When no valid partitions are found, guarantee that we return -1. This most likely already happens, since the most recent get_partition_info() will have returned an error. However, it's best to be explicit. Remove an unnecessary assignment of ret=0 in the success case; this value is over-written with the processed partition ID later. Signed-off-by: Stephen Warren <swarren@nvidia.com>
-rw-r--r--disk/part.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/disk/part.c b/disk/part.c
index 3022969..a0c77dd 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -624,9 +624,9 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
*/
if (p == MAX_SEARCH_PARTITIONS + 1)
*info = tmpinfo;
- ret = 0;
} else {
printf("** No valid partitions found **\n");
+ ret = -1;
goto cleanup;
}
}