speedtch testatm.c,1.1,1.2
Duncan Sands
duncan at infradead.org
Tue Feb 1 18:26:49 EST 2005
Update of /home/cvs/speedtch
In directory phoenix.infradead.org:/tmp/cvs-serv26829
Modified Files:
testatm.c
Log Message:
Update to new registration scheme.
Index: testatm.c
===================================================================
RCS file: /home/cvs/speedtch/testatm.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- testatm.c 28 Jan 2005 23:51:52 -0000 1.1
+++ testatm.c 1 Feb 2005 23:26:47 -0000 1.2
@@ -21,35 +21,36 @@
#include "usbatm.h"
-static const char testatm_driver_name[] = "testatm";
-
uint idVendor;
module_param(idVendor, uint, 0444);
uint idProduct;
module_param(idProduct, uint, 0444);
+static struct usbatm_driver testatm_driver_0 = {
+ .owner = THIS_MODULE,
+ .driver_name = "testatm_0"
+};
+
+static int testatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
+{
+ return usbatm_usb_probe(intf, id, &testatm_driver_0);
+}
+
static struct usb_device_id testatm_usb_ids[] = {
{}, {}
};
static struct usb_driver testatm_usb_driver = {
.owner = THIS_MODULE,
- .name = testatm_driver_name,
- .probe = usbatm_usb_probe,
+ .name = "testatm",
+ .probe = testatm_usb_probe,
.disconnect = usbatm_usb_disconnect,
.id_table = testatm_usb_ids
};
-static struct usbatm_driver testatm_driver_1 = {
- .owner = THIS_MODULE,
- .driver_name = testatm_driver_name
-};
-
static int __init testatm_init(void)
{
- int ret;
-
dbg("testatm_init");
printk("idVendor: %04x\n", idVendor);
@@ -59,19 +60,7 @@
testatm_usb_ids[0].idVendor = idVendor;
testatm_usb_ids[0].idProduct = idProduct;
- if ((ret = usbatm_register(&testatm_driver_1)) < 0)
- goto fail_0;
-
- if ((ret = usb_register(&testatm_usb_driver)) < 0)
- goto fail_all;
-
- return 0;
-
- fail_all:
- usbatm_deregister(&testatm_driver_1);
-
- fail_0:
- return ret;
+ return usb_register(&testatm_usb_driver);
}
module_init(testatm_init);
@@ -80,7 +69,6 @@
dbg("testatm_exit entered");
usb_deregister(&testatm_usb_driver);
- usbatm_deregister(&testatm_driver_1);
}
module_exit(testatm_exit);
More information about the Usbatm-commits
mailing list