libusb: return oocd error values
keep same return style where possible Change-Id: I2f9b85dbc307a483609f76a84de77e3c74d346c7 Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-on: http://openocd.zylin.com/4588 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
This commit is contained in:
parent
ab858febb6
commit
d1b7437633
src/jtag/drivers
|
@ -71,11 +71,11 @@ int jtag_libusb_open(const uint16_t vids[], const uint16_t pids[],
|
||||||
struct jtag_libusb_device_handle **out)
|
struct jtag_libusb_device_handle **out)
|
||||||
{
|
{
|
||||||
int cnt, idx, errCode;
|
int cnt, idx, errCode;
|
||||||
int retval = -ENODEV;
|
int retval = ERROR_FAIL;
|
||||||
struct jtag_libusb_device_handle *libusb_handle = NULL;
|
struct jtag_libusb_device_handle *libusb_handle = NULL;
|
||||||
|
|
||||||
if (libusb_init(&jtag_libusb_context) < 0)
|
if (libusb_init(&jtag_libusb_context) < 0)
|
||||||
return -ENODEV;
|
return ERROR_FAIL;
|
||||||
|
|
||||||
cnt = libusb_get_device_list(jtag_libusb_context, &devs);
|
cnt = libusb_get_device_list(jtag_libusb_context, &devs);
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ int jtag_libusb_open(const uint16_t vids[], const uint16_t pids[],
|
||||||
|
|
||||||
/* Success. */
|
/* Success. */
|
||||||
*out = libusb_handle;
|
*out = libusb_handle;
|
||||||
retval = 0;
|
retval = ERROR_OK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (cnt >= 0)
|
if (cnt >= 0)
|
||||||
|
|
Loading…
Reference in New Issue