summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authorzhkag <[email protected]>2023-06-21 10:22:42 +0000
committerGitHub <[email protected]>2023-06-21 18:22:42 +0800
commit33f550cb65c950068ff04c331daeeda3547d2e50 (patch)
treed04ca979398cfaa280cd9f19e400a40943f96bde /components/drivers
parentb4e59bac4e2d8b039a2365ddc219ac9a3caf0f77 (diff)
[Kernel] message 可以返回消息的实际大小 (#7709)
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/usb/usbdevice/class/hid.c2
-rw-r--r--components/drivers/usb/usbdevice/core/usbdevice_core.c2
-rw-r--r--components/drivers/usb/usbhost/core/hub.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/components/drivers/usb/usbdevice/class/hid.c b/components/drivers/usb/usbdevice/class/hid.c
index d2bb05ed24..59816df4a9 100644
--- a/components/drivers/usb/usbdevice/class/hid.c
+++ b/components/drivers/usb/usbdevice/class/hid.c
@@ -627,7 +627,7 @@ static void hid_thread_entry(void* parameter)
hiddev = (struct hid_s *)parameter;
while(1)
{
- if(rt_mq_recv(&hiddev->hid_mq, &report, sizeof(report),RT_WAITING_FOREVER) != RT_EOK )
+ if(rt_mq_recv(&hiddev->hid_mq, &report, sizeof(report),RT_WAITING_FOREVER) < 0)
continue;
HID_Report_Received(&report);
}
diff --git a/components/drivers/usb/usbdevice/core/usbdevice_core.c b/components/drivers/usb/usbdevice/core/usbdevice_core.c
index 28e673d2a8..b373150800 100644
--- a/components/drivers/usb/usbdevice/core/usbdevice_core.c
+++ b/components/drivers/usb/usbdevice/core/usbdevice_core.c
@@ -2160,7 +2160,7 @@ static void rt_usbd_thread_entry(void* parameter)
/* receive message */
if(rt_mq_recv(&usb_mq, &msg, sizeof(struct udev_msg),
- RT_WAITING_FOREVER) != RT_EOK )
+ RT_WAITING_FOREVER) < 0)
continue;
device = rt_usbd_find_device(msg.dcd);
diff --git a/components/drivers/usb/usbhost/core/hub.c b/components/drivers/usb/usbhost/core/hub.c
index 549fe373d4..bf55be3452 100644
--- a/components/drivers/usb/usbhost/core/hub.c
+++ b/components/drivers/usb/usbhost/core/hub.c
@@ -659,8 +659,8 @@ static void rt_usbh_hub_thread_entry(void* parameter)
struct uhost_msg msg;
/* receive message */
- if(rt_mq_recv(hcd->usb_mq, &msg, sizeof(struct uhost_msg), RT_WAITING_FOREVER)
- != RT_EOK ) continue;
+ if (rt_mq_recv(hcd->usb_mq, &msg, sizeof(struct uhost_msg), RT_WAITING_FOREVER) < 0)
+ continue;
//RT_DEBUG_LOG(RT_DEBUG_USB, ("msg type %d\n", msg.type));
@@ -711,7 +711,7 @@ void rt_usbh_hub_init(uhcd_t hcd)
{
LOG_E("hcd->roothub: allocate buffer failed.");
return;
- }
+ }
rt_memset(hcd->roothub, 0, sizeof(struct uhub));
hcd->roothub->is_roothub = RT_TRUE;
hcd->roothub->hcd = hcd;