From 93f1508cffc3d578c2b7bbbf298dc52326b80777 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 18 Nov 2011 09:47:34 -0800 Subject: [PATCH] USB: convert drivers/bluetooth/* to use module_usb_driver() This converts the drivers in drivers/bluetooth/* 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: Marcel Holtmann Cc: "Gustavo F. Padovan" Signed-off-by: Greg Kroah-Hartman --- drivers/bluetooth/ath3k.c | 14 +------------- drivers/bluetooth/bcm203x.c | 21 +-------------------- drivers/bluetooth/bfusb.c | 21 +-------------------- drivers/bluetooth/bpa10x.c | 15 +-------------- drivers/bluetooth/btusb.c | 15 +-------------- 5 files changed, 5 insertions(+), 81 deletions(-) diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 106beb194f3..cf77a9a2bfa 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c @@ -423,19 +423,7 @@ static struct usb_driver ath3k_driver = { .id_table = ath3k_table, }; -static int __init ath3k_init(void) -{ - BT_INFO("Atheros AR30xx firmware driver ver %s", VERSION); - return usb_register(&ath3k_driver); -} - -static void __exit ath3k_exit(void) -{ - usb_deregister(&ath3k_driver); -} - -module_init(ath3k_init); -module_exit(ath3k_exit); +module_usb_driver(ath3k_driver); MODULE_AUTHOR("Atheros Communications"); MODULE_DESCRIPTION("Atheros AR30xx firmware driver"); diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c index 54952ab800b..1e742a50e2c 100644 --- a/drivers/bluetooth/bcm203x.c +++ b/drivers/bluetooth/bcm203x.c @@ -281,26 +281,7 @@ static struct usb_driver bcm203x_driver = { .id_table = bcm203x_table, }; -static int __init bcm203x_init(void) -{ - int err; - - BT_INFO("Broadcom Blutonium firmware driver ver %s", VERSION); - - err = usb_register(&bcm203x_driver); - if (err < 0) - BT_ERR("Failed to register USB driver"); - - return err; -} - -static void __exit bcm203x_exit(void) -{ - usb_deregister(&bcm203x_driver); -} - -module_init(bcm203x_init); -module_exit(bcm203x_exit); +module_usb_driver(bcm203x_driver); MODULE_AUTHOR("Marcel Holtmann "); MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION); diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index 61b591470a9..e64a290a1b9 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c @@ -764,26 +764,7 @@ static struct usb_driver bfusb_driver = { .id_table = bfusb_table, }; -static int __init bfusb_init(void) -{ - int err; - - BT_INFO("BlueFRITZ! USB driver ver %s", VERSION); - - err = usb_register(&bfusb_driver); - if (err < 0) - BT_ERR("Failed to register BlueFRITZ! USB driver"); - - return err; -} - -static void __exit bfusb_exit(void) -{ - usb_deregister(&bfusb_driver); -} - -module_init(bfusb_init); -module_exit(bfusb_exit); +module_usb_driver(bfusb_driver); MODULE_AUTHOR("Marcel Holtmann "); MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION); diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index 751b338d904..62831603de5 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c @@ -521,20 +521,7 @@ static struct usb_driver bpa10x_driver = { .id_table = bpa10x_table, }; -static int __init bpa10x_init(void) -{ - BT_INFO("Digianswer Bluetooth USB driver ver %s", VERSION); - - return usb_register(&bpa10x_driver); -} - -static void __exit bpa10x_exit(void) -{ - usb_deregister(&bpa10x_driver); -} - -module_init(bpa10x_init); -module_exit(bpa10x_exit); +module_usb_driver(bpa10x_driver); MODULE_AUTHOR("Marcel Holtmann "); MODULE_DESCRIPTION("Digianswer Bluetooth USB driver ver " VERSION); diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index f9b726091ad..b0e6d8d5b96 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1220,20 +1220,7 @@ static struct usb_driver btusb_driver = { .supports_autosuspend = 1, }; -static int __init btusb_init(void) -{ - BT_INFO("Generic Bluetooth USB driver ver %s", VERSION); - - return usb_register(&btusb_driver); -} - -static void __exit btusb_exit(void) -{ - usb_deregister(&btusb_driver); -} - -module_init(btusb_init); -module_exit(btusb_exit); +module_usb_driver(btusb_driver); module_param(ignore_dga, bool, 0644); MODULE_PARM_DESC(ignore_dga, "Ignore devices with id 08fd:0001"); -- 2.11.4.GIT