usbatm xusbatm.c,1.9,1.10
kagan at infradead.org
kagan at infradead.org
Fri Apr 22 02:49:35 EDT 2005
Update of /home/cvs/usbatm
In directory phoenix.infradead.org:/tmp/cvs-serv24428
Modified Files:
xusbatm.c
Log Message:
No need to identify interfaces by numbers: pointers will do.
Index: xusbatm.c
===================================================================
RCS file: /home/cvs/usbatm/xusbatm.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- xusbatm.c 21 Apr 2005 17:37:45 -0000 1.9
+++ xusbatm.c 22 Apr 2005 06:49:32 -0000 1.10
@@ -67,7 +67,6 @@
{
struct usb_device *usb_dev = interface_to_usbdev(intf);
int drv_ix = id - xusbatm_usb_ids;
- int ifnum = intf->altsetting->desc.bInterfaceNumber;
int rx_ep_present = usb_intf_has_ep(intf, rx_endpoint[drv_ix]);
int tx_ep_present = usb_intf_has_ep(intf, tx_endpoint[drv_ix]);
u8 searched_ep = rx_ep_present ? tx_endpoint[drv_ix] : rx_endpoint[drv_ix];
@@ -81,7 +80,8 @@
if (!rx_ep_present && !tx_ep_present) {
usb_dbg(usbatm_instance, "%s: intf #%d has neither tx (%#x) nor rx (%#x) endpoint\n",
- __func__, ifnum, rx_endpoint[drv_ix], tx_endpoint[drv_ix]);
+ __func__, intf->altsetting->desc.bInterfaceNumber,
+ rx_endpoint[drv_ix], tx_endpoint[drv_ix]);
return -ENODEV;
}
@@ -90,14 +90,13 @@
for(i = 0; i < usb_dev->actconfig->desc.bNumInterfaces; i++) {
struct usb_interface *cur_if = usb_dev->actconfig->interface[i];
- int cur_ifnum = cur_if->altsetting->desc.bInterfaceNumber;
- if (cur_ifnum != ifnum && usb_intf_has_ep(cur_if, searched_ep)) {
+ if (cur_if != intf && usb_intf_has_ep(cur_if, searched_ep)) {
ret = usb_driver_claim_interface(&xusbatm_usb_driver,
cur_if, usbatm_instance);
if (!ret)
usb_err(usbatm_instance, "%s: failed to claim interface #%d (%d)\n",
- __func__, cur_ifnum, ret);
+ __func__, cur_if->altsetting->desc.bInterfaceNumber, ret);
return ret;
}
}
More information about the Usbatm-commits
mailing list