mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-10 07:29:40 +00:00
rtl8188eu: usb_dvobj_init(): A NULL pointer check for usb_host_endpoints makes no sense
Simplify the code. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
849d585656
commit
86fdc52e9a
1 changed files with 14 additions and 35 deletions
|
@ -161,7 +161,6 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
|
||||||
struct usb_config_descriptor *pconf_desc;
|
struct usb_config_descriptor *pconf_desc;
|
||||||
struct usb_host_interface *phost_iface;
|
struct usb_host_interface *phost_iface;
|
||||||
struct usb_interface_descriptor *piface_desc;
|
struct usb_interface_descriptor *piface_desc;
|
||||||
struct usb_host_endpoint *phost_endp;
|
|
||||||
struct usb_endpoint_descriptor *pendp_desc;
|
struct usb_endpoint_descriptor *pendp_desc;
|
||||||
struct usb_device *pusbd;
|
struct usb_device *pusbd;
|
||||||
|
|
||||||
|
@ -190,44 +189,24 @@ _func_enter_;
|
||||||
pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
|
pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
|
||||||
|
|
||||||
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
|
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
|
||||||
phost_endp = phost_iface->endpoint + i;
|
int ep_num;
|
||||||
if (phost_endp) {
|
pendp_desc = &phost_iface->endpoint[i].desc;
|
||||||
pendp_desc = &phost_endp->desc;
|
|
||||||
|
|
||||||
DBG_88E("\nusb_endpoint_descriptor(%d):\n", i);
|
ep_num = usb_endpoint_num(pendp_desc);
|
||||||
DBG_88E("bLength=%x\n", pendp_desc->bLength);
|
|
||||||
DBG_88E("bDescriptorType=%x\n",
|
|
||||||
pendp_desc->bDescriptorType);
|
|
||||||
DBG_88E("bEndpointAddress=%x\n",
|
|
||||||
pendp_desc->bEndpointAddress);
|
|
||||||
DBG_88E("wMaxPacketSize=%d\n",
|
|
||||||
le16_to_cpu(pendp_desc->wMaxPacketSize));
|
|
||||||
DBG_88E("bInterval=%x\n", pendp_desc->bInterval);
|
|
||||||
|
|
||||||
if (RT_usb_endpoint_is_bulk_in(pendp_desc)) {
|
if (usb_endpoint_is_bulk_in(pendp_desc)) {
|
||||||
DBG_88E("RT_usb_endpoint_is_bulk_in = %x\n",
|
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
|
||||||
RT_usb_endpoint_num(pendp_desc));
|
|
||||||
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = RT_usb_endpoint_num(pendp_desc);
|
|
||||||
pdvobjpriv->RtNumInPipes++;
|
pdvobjpriv->RtNumInPipes++;
|
||||||
} else if (usb_endpoint_is_int(pendp_desc)) {
|
} else if (usb_endpoint_is_int_in(pendp_desc)) {
|
||||||
DBG_88E("usb_endpoint_is_int = %x, Interval = %x\n",
|
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
|
||||||
RT_usb_endpoint_num(pendp_desc),
|
|
||||||
pendp_desc->bInterval);
|
|
||||||
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = RT_usb_endpoint_num(pendp_desc);
|
|
||||||
pdvobjpriv->RtNumInPipes++;
|
pdvobjpriv->RtNumInPipes++;
|
||||||
} else if (RT_usb_endpoint_is_bulk_out(pendp_desc)) {
|
} else if (usb_endpoint_is_bulk_out(pendp_desc)) {
|
||||||
DBG_88E("RT_usb_endpoint_is_bulk_out = %x\n",
|
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] =
|
||||||
RT_usb_endpoint_num(pendp_desc));
|
ep_num;
|
||||||
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] = RT_usb_endpoint_num(pendp_desc);
|
|
||||||
pdvobjpriv->RtNumOutPipes++;
|
pdvobjpriv->RtNumOutPipes++;
|
||||||
}
|
}
|
||||||
pdvobjpriv->ep_num[i] = RT_usb_endpoint_num(pendp_desc);
|
pdvobjpriv->ep_num[i] = ep_num;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
DBG_88E("nr_endpoint=%d, in_num=%d, out_num=%d\n\n",
|
|
||||||
pdvobjpriv->nr_endpoint, pdvobjpriv->RtNumInPipes,
|
|
||||||
pdvobjpriv->RtNumOutPipes);
|
|
||||||
|
|
||||||
if (pusbd->speed == USB_SPEED_HIGH) {
|
if (pusbd->speed == USB_SPEED_HIGH) {
|
||||||
pdvobjpriv->ishighspeed = true;
|
pdvobjpriv->ishighspeed = true;
|
||||||
|
|
Loading…
Reference in a new issue