mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
pc/usb: fix ret value of handle_altsetting_request
The logic got accidentally reversed during the transition from the legacy USB driver. Since the function drops error details, this patch adds a diagnostic message with the error code as returned by the Linux driver.
This commit is contained in:
parent
0325be0827
commit
4056fb9127
@ -220,8 +220,13 @@ static genode_usb_request_ret_t
|
||||
handle_altsetting_request(unsigned iface, unsigned alt_setting, void * data)
|
||||
{
|
||||
struct usb_device * udev = (struct usb_device *) data;
|
||||
return (usb_set_interface(udev, iface, alt_setting)) ? NO_ERROR
|
||||
: UNKNOWN_ERROR;
|
||||
int const ret = usb_set_interface(udev, iface, alt_setting);
|
||||
|
||||
if (ret < 0)
|
||||
printk("Alt setting request (iface=%u alt_setting=%u) failed with %d\n",
|
||||
iface, alt_setting, ret);
|
||||
|
||||
return (ret == 0) ? NO_ERROR : UNKNOWN_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user