提交 13a65462 编写于 作者: O openharmony_ci 提交者: Gitee

!17 fix: Codex告警清零

Merge pull request !17 from Far/codex
......@@ -656,7 +656,7 @@ usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *uhe,
struct usb_device_request req;
struct urb *urb;
int err;
uint16_t actlen;
uint16_t actlen = 0;
uint8_t type;
uint8_t addr;
......
......@@ -1270,6 +1270,7 @@ uhub_attach(device_t dev)
uint8_t portno;
uint8_t removable;
uint8_t iface_index;
device_t device;
usb_error_t err;
if (!sc || !uaa || !uaa->device)
......@@ -1558,7 +1559,12 @@ uhub_attach(device_t dev)
break;
if (portno == 1) { /* if it is the hub 1 port */
if (udev->parent_hub == NULL) { /* parent is bus */
parent_info.nameunit = device_get_nameunit(devclass_get_device(devclass_find("usbus"), 0));
device = devclass_get_device(devclass_find("usbus"), 0);
if (device == NULL) {
device_printf(dev, "Can't find device of class usbus\n");
goto error;
}
parent_info.nameunit = device_get_nameunit(device);
parent_info.port_no = 0;
} else { /* parent is hub */
parent_info.nameunit = device_get_nameunit(udev->parent_dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册