misc: Fix up some return codes to respect CUPS_BACKEND_*
This commit is contained in:
parent
6b54cbcb89
commit
125a4ef832
|
@ -643,22 +643,22 @@ static int mitsu9550_query_serno(struct libusb_device_handle *dev, uint8_t endp_
|
|||
|
||||
if ((ret = send_data(dev, endp_down,
|
||||
(uint8_t*) &cmd, sizeof(cmd))))
|
||||
return (ret < 0) ? ret : -99;
|
||||
return (ret < 0) ? ret : CUPS_BACKEND_FAILED;
|
||||
|
||||
ret = read_data(dev, endp_up,
|
||||
rdbuf, READBACK_LEN, &num);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
return CUPS_BACKEND_FAILED;
|
||||
|
||||
if ((unsigned int)num < sizeof(cmd)) /* Short read */
|
||||
return -1;
|
||||
return CUPS_BACKEND_FAILED;
|
||||
|
||||
if (rdbuf[0] != 0xe4 ||
|
||||
rdbuf[1] != 0x72 ||
|
||||
rdbuf[2] != 0x6e ||
|
||||
rdbuf[3] != 0x00) /* Bad response */
|
||||
return -2;
|
||||
return CUPS_BACKEND_FAILED;
|
||||
|
||||
/* If response is truncated, handle it */
|
||||
if ((unsigned int) num < sizeof(cmd) + rdbuf[4] + 1)
|
||||
|
|
|
@ -1803,7 +1803,7 @@ static int shinkos2145_query_serno(struct libusb_device_handle *dev, uint8_t end
|
|||
strncpy(buf, (char*)resp->data, buf_len);
|
||||
buf[buf_len-1] = 0; /* ensure it's null terminated */
|
||||
|
||||
return 0;
|
||||
return CUPS_BACKEND_OK;
|
||||
}
|
||||
|
||||
/* Exported */
|
||||
|
|
Loading…
Reference in a new issue