aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Glass2016-05-01 14:52:36 -0500
committerSimon Glass2016-05-17 10:54:43 -0500
commit1598dfcb101c2c3aaac68a4ac8fc9bdef2293eaa (patch)
treea2feef2a9e449e30f1e27255255f4748a0f48189 /disk/part.c
parentc40fdca6b7db469d3982cc44fd68a269adb41b25 (diff)
downloadu-boot-1598dfcb101c2c3aaac68a4ac8fc9bdef2293eaa.tar.gz
u-boot-1598dfcb101c2c3aaac68a4ac8fc9bdef2293eaa.tar.xz
u-boot-1598dfcb101c2c3aaac68a4ac8fc9bdef2293eaa.zip
dm: blk: Use the correct error code for blk_get_device_by_str()
Return -EINVAL instead of -1 in this function, to provide a more meaningful error. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'disk/part.c')
-rw-r--r--disk/part.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/disk/part.c b/disk/part.c
index 3039f5f235..6a1c02d9fa 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -350,7 +350,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
350 if (*ep) { 350 if (*ep) {
351 printf("** Bad device specification %s %s **\n", 351 printf("** Bad device specification %s %s **\n",
352 ifname, dev_str); 352 ifname, dev_str);
353 dev = -1; 353 dev = -EINVAL;
354 goto cleanup; 354 goto cleanup;
355 } 355 }
356 356
@@ -359,7 +359,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
359 if (*ep) { 359 if (*ep) {
360 printf("** Bad HW partition specification %s %s **\n", 360 printf("** Bad HW partition specification %s %s **\n",
361 ifname, hwpart_str); 361 ifname, hwpart_str);
362 dev = -1; 362 dev = -EINVAL;
363 goto cleanup; 363 goto cleanup;
364 } 364 }
365 } 365 }
@@ -367,7 +367,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
367 *dev_desc = get_dev_hwpart(ifname, dev, hwpart); 367 *dev_desc = get_dev_hwpart(ifname, dev, hwpart);
368 if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) { 368 if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) {
369 printf("** Bad device %s %s **\n", ifname, dev_hwpart_str); 369 printf("** Bad device %s %s **\n", ifname, dev_hwpart_str);
370 dev = -1; 370 dev = -ENOENT;
371 goto cleanup; 371 goto cleanup;
372 } 372 }
373 373