Return -EINVAL instead of -1 in this function, to provide a more meaningful
error.
Signed-off-by: Simon Glass <sjg@chromium.org>
if (*ep) {
printf("** Bad device specification %s %s **\n",
ifname, dev_str);
- dev = -1;
+ dev = -EINVAL;
goto cleanup;
}
if (*ep) {
printf("** Bad HW partition specification %s %s **\n",
ifname, hwpart_str);
- dev = -1;
+ dev = -EINVAL;
goto cleanup;
}
}
*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;
}