[PATCH] usbatm.[ch]: brown paper bag
Roman Kagan
rkagan at mail.ru
Fri Apr 1 04:49:55 EST 2005
In the attempt to better organize the driver initialization we've
forgotten about one of its primary goals: to give the subdriver access
to the usb_device_id pointer passed to probe. Below is the trivial
patch that fixes it. The patch to cxacru actually using this will
follow.
OK to commit?
Roman.
Index: usbatm.h
===================================================================
RCS file: /home/cvs/usbatm/usbatm.h,v
retrieving revision 1.10
diff -u -p -r1.10 usbatm.h
--- usbatm.h 7 Feb 2005 23:50:41 -0000 1.10
+++ usbatm.h 1 Apr 2005 09:41:41 -0000
@@ -69,7 +69,8 @@ struct usbatm_driver {
* init device ... can sleep, or cause probe() failure. Drivers with a heavy_init
* method can avoid the call to heavy_init by setting need_heavy_init to zero.
*/
- int (*bind) (struct usbatm_data *, struct usb_interface *, int *need_heavy_init);
+ int (*bind) (struct usbatm_data *, struct usb_interface *,
+ const struct usb_device_id *id, int *need_heavy_init);
/* additional device initialization that is too slow to be done in probe() */
int (*heavy_init) (struct usbatm_data *, struct usb_interface *);
Index: usbatm.c
===================================================================
RCS file: /home/cvs/usbatm/usbatm.c,v
retrieving revision 1.15
diff -u -p -r1.15 usbatm.c
--- usbatm.c 4 Mar 2005 11:30:58 -0000 1.15
+++ usbatm.c 1 Apr 2005 09:41:42 -0000
@@ -1091,7 +1091,7 @@ int usbatm_usb_probe (struct usb_interfa
bind:
need_heavy = 1;
- if (driver->bind && (error = driver->bind(instance, intf, &need_heavy)) < 0) {
+ if (driver->bind && (error = driver->bind(instance, intf, id, &need_heavy)) < 0) {
dev_dbg(&intf->dev, "bind failed: %d!\n", error);
goto fail_free;
}
More information about the Usbatm
mailing list