summaryrefslogtreecommitdiff
path: root/disk/part.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-05-01 13:52:36 -0600
committerSimon Glass <sjg@chromium.org>2016-05-17 09:54:43 -0600
commit1598dfcb101c2c3aaac68a4ac8fc9bdef2293eaa (patch)
treea2feef2a9e449e30f1e27255255f4748a0f48189 /disk/part.c
parentc40fdca6b7db469d3982cc44fd68a269adb41b25 (diff)
downloadu-boot-imx-1598dfcb101c2c3aaac68a4ac8fc9bdef2293eaa.zip
u-boot-imx-1598dfcb101c2c3aaac68a4ac8fc9bdef2293eaa.tar.gz
u-boot-imx-1598dfcb101c2c3aaac68a4ac8fc9bdef2293eaa.tar.bz2
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 3039f5f..6a1c02d 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,
if (*ep) {
printf("** Bad device specification %s %s **\n",
ifname, dev_str);
- dev = -1;
+ dev = -EINVAL;
goto cleanup;
}
@@ -359,7 +359,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
if (*ep) {
printf("** Bad HW partition specification %s %s **\n",
ifname, hwpart_str);
- dev = -1;
+ dev = -EINVAL;
goto cleanup;
}
}
@@ -367,7 +367,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
*dev_desc = get_dev_hwpart(ifname, dev, hwpart);
if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) {
printf("** Bad device %s %s **\n", ifname, dev_hwpart_str);
- dev = -1;
+ dev = -ENOENT;
goto cleanup;
}