replace ssize_t with int

This commit is contained in:
sakumisu
2022-02-07 17:32:36 +08:00
parent eb08bcc5a0
commit 1cb56fe0ef
4 changed files with 119 additions and 18 deletions

View File

@@ -175,7 +175,8 @@ int usbh_hid_connect(struct usbh_hubport *hport, uint8_t intf)
struct usbh_hid *hid_class = usb_malloc(sizeof(struct usbh_hid));
if (hid_class == NULL) {
return -1;
USB_LOG_ERR("Fail to alloc hid_class\r\n");
return -ENOMEM;
}
memset(hid_class, 0, sizeof(struct usbh_hid));
@@ -185,6 +186,10 @@ int usbh_hid_connect(struct usbh_hubport *hport, uint8_t intf)
hport->config.intf[intf].priv = hid_class;
hid_class->setup = usb_iomalloc(sizeof(struct usb_setup_packet));
if (hid_class->setup == NULL) {
USB_LOG_ERR("Fail to alloc setup\r\n");
return -ENOMEM;
}
hid_class->intf = intf;
ret = usbh_hid_set_idle(hport, intf, 0, 0);