Merge commit '070680218379e15c1901f4bf21b98e3cbf12b527' into stable/for-linus-fixes-3.3
[linux-2.6.git] / drivers / net / usb / cdc_ether.c
index 99ed6eb..41a61ef 100644 (file)
@@ -425,6 +425,9 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
        int                             status;
        struct cdc_state                *info = (void *) &dev->data;
 
+       BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
+                       < sizeof(struct cdc_state)));
+
        status = usbnet_generic_cdc_bind(dev, intf);
        if (status < 0)
                return status;
@@ -615,21 +618,7 @@ static struct usb_driver cdc_driver = {
        .supports_autosuspend = 1,
 };
 
-
-static int __init cdc_init(void)
-{
-       BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
-                       < sizeof(struct cdc_state)));
-
-       return usb_register(&cdc_driver);
-}
-module_init(cdc_init);
-
-static void __exit cdc_exit(void)
-{
-       usb_deregister(&cdc_driver);
-}
-module_exit(cdc_exit);
+module_usb_driver(cdc_driver);
 
 MODULE_AUTHOR("David Brownell");
 MODULE_DESCRIPTION("USB CDC Ethernet devices");