aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2011-11-18 12:52:10 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-18 12:52:10 -0500
commitfe7484834bb614c2c205726647635171ce6cc070 (patch)
treee96e560153c2d4a2b2ad1feba6cc4fe09dbb5a29
parent424f0750edd5af866f80f5e65998e0610503cb5c (diff)
USB: convert some miscellanies drivers to use module_usb_driver()
This converts the remaining USB drivers in the kernel to use the module_usb_driver() macro which makes the code smaller and a bit simpler. Added bonus is that it removes some unneeded kernel log messages about drivers loading and/or unloading. Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Till Harbaum <till@harbaum.org> Cc: Karsten Keil <isdn@linux-pingi.de> Cc: Chris Ball <cjb@laptop.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: Steve Glendinning <steve.glendinning@smsc.com> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Evgeniy Polyakov <zbr@ioremap.net> Cc: Wim Van Sebroeck <wim@iguana.be> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jesper Juhl <jj@chaosbits.net> Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Cc: Jamie Iles <jamie@jamieiles.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/i2c/busses/i2c-diolan-u2c.c15
-rw-r--r--drivers/i2c/busses/i2c-tiny-usb.c15
-rw-r--r--drivers/isdn/hardware/mISDN/hfcsusb.c28
-rw-r--r--drivers/mmc/host/ushc.c12
-rw-r--r--drivers/mtd/nand/alauda.c13
-rw-r--r--drivers/nfc/pn533.c19
-rw-r--r--drivers/uwb/hwa-rc.c12
-rw-r--r--drivers/uwb/i1480/dfu/usb.c20
-rw-r--r--drivers/video/smscufx.c19
-rw-r--r--drivers/video/udlfb.c19
-rw-r--r--drivers/w1/masters/ds2490.c21
-rw-r--r--drivers/watchdog/pcwd_usb.c35
12 files changed, 12 insertions, 216 deletions
diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c
index 76366716a854..7eb19a5222f2 100644
--- a/drivers/i2c/busses/i2c-diolan-u2c.c
+++ b/drivers/i2c/busses/i2c-diolan-u2c.c
@@ -515,20 +515,7 @@ static struct usb_driver diolan_u2c_driver = {
515 .id_table = diolan_u2c_table, 515 .id_table = diolan_u2c_table,
516}; 516};
517 517
518static int __init diolan_u2c_init(void) 518module_usb_driver(diolan_u2c_driver);
519{
520 /* register this driver with the USB subsystem */
521 return usb_register(&diolan_u2c_driver);
522}
523
524static void __exit diolan_u2c_exit(void)
525{
526 /* deregister this driver with the USB subsystem */
527 usb_deregister(&diolan_u2c_driver);
528}
529
530module_init(diolan_u2c_init);
531module_exit(diolan_u2c_exit);
532 519
533MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); 520MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>");
534MODULE_DESCRIPTION(DRIVER_NAME " driver"); 521MODULE_DESCRIPTION(DRIVER_NAME " driver");
diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c
index d03b04002f0d..f07307ff360d 100644
--- a/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/drivers/i2c/busses/i2c-tiny-usb.c
@@ -262,20 +262,7 @@ static struct usb_driver i2c_tiny_usb_driver = {
262 .id_table = i2c_tiny_usb_table, 262 .id_table = i2c_tiny_usb_table,
263}; 263};
264 264
265static int __init usb_i2c_tiny_usb_init(void) 265module_usb_driver(i2c_tiny_usb_driver);
266{
267 /* register this driver with the USB subsystem */
268 return usb_register(&i2c_tiny_usb_driver);
269}
270
271static void __exit usb_i2c_tiny_usb_exit(void)
272{
273 /* deregister this driver with the USB subsystem */
274 usb_deregister(&i2c_tiny_usb_driver);
275}
276
277module_init(usb_i2c_tiny_usb_init);
278module_exit(usb_i2c_tiny_usb_exit);
279 266
280/* ----- end of usb layer ------------------------------------------------ */ 267/* ----- end of usb layer ------------------------------------------------ */
281 268
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
index 71a8eb6ef71e..0e1f4d5b9774 100644
--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
+++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
@@ -2154,30 +2154,4 @@ static struct usb_driver hfcsusb_drv = {
2154 .disconnect = hfcsusb_disconnect, 2154 .disconnect = hfcsusb_disconnect,
2155}; 2155};
2156 2156
2157static int __init 2157module_usb_driver(hfcsusb_drv);
2158hfcsusb_init(void)
2159{
2160 printk(KERN_INFO DRIVER_NAME " driver Rev. %s debug(0x%x) poll(%i)\n",
2161 hfcsusb_rev, debug, poll);
2162
2163 if (usb_register(&hfcsusb_drv)) {
2164 printk(KERN_INFO DRIVER_NAME
2165 ": Unable to register hfcsusb module at usb stack\n");
2166 return -ENODEV;
2167 }
2168
2169 return 0;
2170}
2171
2172static void __exit
2173hfcsusb_cleanup(void)
2174{
2175 if (debug & DBG_HFC_CALL_TRACE)
2176 printk(KERN_INFO DRIVER_NAME ": %s\n", __func__);
2177
2178 /* unregister Hardware */
2179 usb_deregister(&hfcsusb_drv); /* release our driver */
2180}
2181
2182module_init(hfcsusb_init);
2183module_exit(hfcsusb_cleanup);
diff --git a/drivers/mmc/host/ushc.c b/drivers/mmc/host/ushc.c
index f08f944ac53c..c0105a2e269a 100644
--- a/drivers/mmc/host/ushc.c
+++ b/drivers/mmc/host/ushc.c
@@ -562,17 +562,7 @@ static struct usb_driver ushc_driver = {
562 .disconnect = ushc_disconnect, 562 .disconnect = ushc_disconnect,
563}; 563};
564 564
565static int __init ushc_init(void) 565module_usb_driver(ushc_driver);
566{
567 return usb_register(&ushc_driver);
568}
569module_init(ushc_init);
570
571static void __exit ushc_exit(void)
572{
573 usb_deregister(&ushc_driver);
574}
575module_exit(ushc_exit);
576 566
577MODULE_DESCRIPTION("USB SD Host Controller driver"); 567MODULE_DESCRIPTION("USB SD Host Controller driver");
578MODULE_AUTHOR("David Vrabel <david.vrabel@csr.com>"); 568MODULE_AUTHOR("David Vrabel <david.vrabel@csr.com>");
diff --git a/drivers/mtd/nand/alauda.c b/drivers/mtd/nand/alauda.c
index eb40ea829ab2..6a5ff64a139e 100644
--- a/drivers/mtd/nand/alauda.c
+++ b/drivers/mtd/nand/alauda.c
@@ -717,17 +717,6 @@ static struct usb_driver alauda_driver = {
717 .id_table = alauda_table, 717 .id_table = alauda_table,
718}; 718};
719 719
720static int __init alauda_init(void) 720module_usb_driver(alauda_driver);
721{
722 return usb_register(&alauda_driver);
723}
724
725static void __exit alauda_exit(void)
726{
727 usb_deregister(&alauda_driver);
728}
729
730module_init(alauda_init);
731module_exit(alauda_exit);
732 721
733MODULE_LICENSE("GPL"); 722MODULE_LICENSE("GPL");
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 7bcb1febef0d..bd023847efb2 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -1597,24 +1597,7 @@ static struct usb_driver pn533_driver = {
1597 .id_table = pn533_table, 1597 .id_table = pn533_table,
1598}; 1598};
1599 1599
1600static int __init pn533_init(void) 1600module_usb_driver(pn533_driver);
1601{
1602 int rc;
1603
1604 rc = usb_register(&pn533_driver);
1605 if (rc)
1606 err("usb_register failed. Error number %d", rc);
1607
1608 return rc;
1609}
1610
1611static void __exit pn533_exit(void)
1612{
1613 usb_deregister(&pn533_driver);
1614}
1615
1616module_init(pn533_init);
1617module_exit(pn533_exit);
1618 1601
1619MODULE_AUTHOR("Lauro Ramos Venancio <lauro.venancio@openbossa.org>," 1602MODULE_AUTHOR("Lauro Ramos Venancio <lauro.venancio@openbossa.org>,"
1620 " Aloisio Almeida Jr <aloisio.almeida@openbossa.org>"); 1603 " Aloisio Almeida Jr <aloisio.almeida@openbossa.org>");
diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
index 2babcd4fbfc1..66797e9c5010 100644
--- a/drivers/uwb/hwa-rc.c
+++ b/drivers/uwb/hwa-rc.c
@@ -914,17 +914,7 @@ static struct usb_driver hwarc_driver = {
914 .post_reset = hwarc_post_reset, 914 .post_reset = hwarc_post_reset,
915}; 915};
916 916
917static int __init hwarc_driver_init(void) 917module_usb_driver(hwarc_driver);
918{
919 return usb_register(&hwarc_driver);
920}
921module_init(hwarc_driver_init);
922
923static void __exit hwarc_driver_exit(void)
924{
925 usb_deregister(&hwarc_driver);
926}
927module_exit(hwarc_driver_exit);
928 918
929MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); 919MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
930MODULE_DESCRIPTION("Host Wireless Adapter Radio Control Driver"); 920MODULE_DESCRIPTION("Host Wireless Adapter Radio Control Driver");
diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c
index ba8664328afa..c8f684833d58 100644
--- a/drivers/uwb/i1480/dfu/usb.c
+++ b/drivers/uwb/i1480/dfu/usb.c
@@ -451,25 +451,7 @@ static struct usb_driver i1480_dfu_driver = {
451 .disconnect = NULL, 451 .disconnect = NULL,
452}; 452};
453 453
454 454module_usb_driver(i1480_dfu_driver);
455/*
456 * Initialize the i1480 DFU driver.
457 *
458 * We also need to register our function for guessing event sizes.
459 */
460static int __init i1480_dfu_driver_init(void)
461{
462 return usb_register(&i1480_dfu_driver);
463}
464module_init(i1480_dfu_driver_init);
465
466
467static void __exit i1480_dfu_driver_exit(void)
468{
469 usb_deregister(&i1480_dfu_driver);
470}
471module_exit(i1480_dfu_driver_exit);
472
473 455
474MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); 456MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
475MODULE_DESCRIPTION("Intel Wireless UWB Link 1480 firmware uploader for USB"); 457MODULE_DESCRIPTION("Intel Wireless UWB Link 1480 firmware uploader for USB");
diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c
index aaccffac67ab..3c22994ea31a 100644
--- a/drivers/video/smscufx.c
+++ b/drivers/video/smscufx.c
@@ -1792,24 +1792,7 @@ static struct usb_driver ufx_driver = {
1792 .id_table = id_table, 1792 .id_table = id_table,
1793}; 1793};
1794 1794
1795static int __init ufx_module_init(void) 1795module_usb_driver(ufx_driver);
1796{
1797 int res;
1798
1799 res = usb_register(&ufx_driver);
1800 if (res)
1801 err("usb_register failed. Error number %d", res);
1802
1803 return res;
1804}
1805
1806static void __exit ufx_module_exit(void)
1807{
1808 usb_deregister(&ufx_driver);
1809}
1810
1811module_init(ufx_module_init);
1812module_exit(ufx_module_exit);
1813 1796
1814static void ufx_urb_completion(struct urb *urb) 1797static void ufx_urb_completion(struct urb *urb)
1815{ 1798{
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 3473e75ce785..1f868d0187a2 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -1761,24 +1761,7 @@ static struct usb_driver dlfb_driver = {
1761 .id_table = id_table, 1761 .id_table = id_table,
1762}; 1762};
1763 1763
1764static int __init dlfb_module_init(void) 1764module_usb_driver(dlfb_driver);
1765{
1766 int res;
1767
1768 res = usb_register(&dlfb_driver);
1769 if (res)
1770 err("usb_register failed. Error number %d", res);
1771
1772 return res;
1773}
1774
1775static void __exit dlfb_module_exit(void)
1776{
1777 usb_deregister(&dlfb_driver);
1778}
1779
1780module_init(dlfb_module_init);
1781module_exit(dlfb_module_exit);
1782 1765
1783static void dlfb_urb_completion(struct urb *urb) 1766static void dlfb_urb_completion(struct urb *urb)
1784{ 1767{
diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index b5abaae38e97..4f7e1d770f81 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -1002,26 +1002,7 @@ static void ds_disconnect(struct usb_interface *intf)
1002 kfree(dev); 1002 kfree(dev);
1003} 1003}
1004 1004
1005static int ds_init(void) 1005module_usb_driver(ds_driver);
1006{
1007 int err;
1008
1009 err = usb_register(&ds_driver);
1010 if (err) {
1011 printk(KERN_INFO "Failed to register DS9490R USB device: err=%d.\n", err);
1012 return err;
1013 }
1014
1015 return 0;
1016}
1017
1018static void ds_fini(void)
1019{
1020 usb_deregister(&ds_driver);
1021}
1022
1023module_init(ds_init);
1024module_exit(ds_fini);
1025 1006
1026MODULE_LICENSE("GPL"); 1007MODULE_LICENSE("GPL");
1027MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); 1008MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index 748a74bd85e7..d8de1ddd176a 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -827,37 +827,4 @@ static void usb_pcwd_disconnect(struct usb_interface *interface)
827 printk(KERN_INFO PFX "USB PC Watchdog disconnected\n"); 827 printk(KERN_INFO PFX "USB PC Watchdog disconnected\n");
828} 828}
829 829
830 830module_usb_driver(usb_pcwd_driver);
831
832/**
833 * usb_pcwd_init
834 */
835static int __init usb_pcwd_init(void)
836{
837 int result;
838
839 /* register this driver with the USB subsystem */
840 result = usb_register(&usb_pcwd_driver);
841 if (result) {
842 printk(KERN_ERR PFX "usb_register failed. Error number %d\n",
843 result);
844 return result;
845 }
846
847 printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION "\n");
848 return 0;
849}
850
851
852/**
853 * usb_pcwd_exit
854 */
855static void __exit usb_pcwd_exit(void)
856{
857 /* deregister this driver with the USB subsystem */
858 usb_deregister(&usb_pcwd_driver);
859}
860
861
862module_init(usb_pcwd_init);
863module_exit(usb_pcwd_exit);