U-Boot DWC2 warning removal
Oleksandr, I made the following changes to remove some warnings from your DWC2 driver. I'm not sure they're correct; perhaps they expose some bugs...
Quoted 13 lines
drivers/usb/host/dwc_otg-hcd.c +0
-1@@ -249,7 +249,6 @@ static int dwc_otg_submit_rh_msg(struct usb_device *dev, unsigned long pipe,int stat =0 ;__u16 bmRType_bReq;__u16 wValue; -__u16 wIndex;__u16 wLength;unsigned char data[32 ];hprt0_data_t hprt0 = {.d32 =0 };
drivers/usb/host/dwc_otg-hcd.c static int dwc_otg_submit_rh_msg(struct usb_device *dev, unsigned long pipe, · line 265
Quoted 7 lines
drivers/usb/host/dwc_otg-hcd.c +0
-1@@ -261,7 +260,6 @@ static int dwc_otg_submit_rh_msg(struct usb_device *dev, unsigned long pipe, bmRType_bReq = cmd->requesttype | (cmd->request <<8 ); wValue =cpu_to_le16 (cmd->value); - wIndex =cpu_to_le16 (cmd->index); wLength =cpu_to_le16 (cmd->length);switch (bmRType_bReq) {
Perhaps wIndex should be used?
Quoted 9 lines
drivers/usb/host/dwc_otg-hcd.c +0
-1@@ -598,7 +596,6 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,hctsiz_data_t hctsiz;dwc_otg_host_if_t *host_if = g_core_if.host_if;dwc_otg_hc_regs_t *hc_regs = host_if->hc_regs[CHANNEL ]; -hcint_data_t hcint;hcint_data_t hcint_new;/* For CONTROL endpoint pid should start with DATA1 */ int status_direction;
drivers/usb/host/dwc_otg-hcd.c int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, · line 636
Quoted 5 lines
drivers/usb/host/dwc_otg-hcd.c +0
-2@@ -632,9 +629,6 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, hcchar.d32 =dwc_read_reg32 (&hc_regs->hcchar); hcchar.b.multicnt =1 ; -/* Remember original int status */ - hcint.d32 =dwc_read_reg32 (&hc_regs->hcint);
Does this read have a side-effect; should I keep the call to dwc_read_reg32(), but just remove the assignment?
The comment implies this value is saved so that it can be restored later. However, I don't see anywhere that restores it; does that code need to be added?
Quoted 22 lines
drivers/usb/host/dwc_otg-hcd.c +0
-5-/* Set host channel enable after all other setup is complete. */ hcchar.b.chen =1 ; hcchar.b.chdis =0 ;@@ -677,8 +671,6 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, hcchar.d32 =dwc_read_reg32 (&hc_regs->hcchar); hcchar.b.multicnt =1 ; - hcint.d32 =dwc_read_reg32 (&hc_regs->hcint); -/* Set host channel enable after all other setup is complete. */ hcchar.b.chen =1 ; hcchar.b.chdis =0 ;@@ -731,8 +723,6 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, hcchar.d32 =dwc_read_reg32 (&hc_regs->hcchar); hcchar.b.multicnt =1 ; - hcint.d32 =dwc_read_reg32 (&hc_regs->hcint); -/* Set host channel enable after all other setup is complete. */ hcchar.b.chen =1 ; hcchar.b.chdis =0 ;