From cc27c96c2bee93068bfc60ea6b09611d88cef429 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 27 Nov 2011 20:16:27 +0800 Subject: usb: convert drivers/usb/* to use module_platform_driver() This patch converts the drivers in drivers/usb/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Felipe Balbi Cc: Li Yang Cc: Kuninori Morimoto Cc: Sarah Sharp Cc: Jiri Kosina Cc: Lucas De Marchi Cc: Alan Stern Signed-off-by: Axel Lin Acked-by: Peter Korsgaard Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fhci-hcd.c | 12 +----------- drivers/usb/host/fsl-mph-dr-of.c | 12 +----------- drivers/usb/host/imx21-hcd.c | 13 +------------ drivers/usb/host/oxu210hp-hcd.c | 19 +------------------ 4 files changed, 4 insertions(+), 52 deletions(-) (limited to 'drivers/usb/host') diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c index 4ed6d19f2a54..d2623747b489 100644 --- a/drivers/usb/host/fhci-hcd.c +++ b/drivers/usb/host/fhci-hcd.c @@ -824,17 +824,7 @@ static struct platform_driver of_fhci_driver = { .remove = __devexit_p(of_fhci_remove), }; -static int __init fhci_module_init(void) -{ - return platform_driver_register(&of_fhci_driver); -} -module_init(fhci_module_init); - -static void __exit fhci_module_exit(void) -{ - platform_driver_unregister(&of_fhci_driver); -} -module_exit(fhci_module_exit); +module_platform_driver(of_fhci_driver); MODULE_DESCRIPTION("USB Freescale Host Controller Interface Driver"); MODULE_AUTHOR("Shlomi Gridish , " diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 9037035ad1e4..7916e56a725e 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -297,17 +297,7 @@ static struct platform_driver fsl_usb2_mph_dr_driver = { .remove = __devexit_p(fsl_usb2_mph_dr_of_remove), }; -static int __init fsl_usb2_mph_dr_init(void) -{ - return platform_driver_register(&fsl_usb2_mph_dr_driver); -} -module_init(fsl_usb2_mph_dr_init); - -static void __exit fsl_usb2_mph_dr_exit(void) -{ - platform_driver_unregister(&fsl_usb2_mph_dr_driver); -} -module_exit(fsl_usb2_mph_dr_exit); +module_platform_driver(fsl_usb2_mph_dr_driver); MODULE_DESCRIPTION("FSL MPH DR OF devices driver"); MODULE_AUTHOR("Anatolij Gustschin "); diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c index 2ee18cfa1efe..6923bcb8aa68 100644 --- a/drivers/usb/host/imx21-hcd.c +++ b/drivers/usb/host/imx21-hcd.c @@ -1924,18 +1924,7 @@ static struct platform_driver imx21_hcd_driver = { .resume = NULL, }; -static int __init imx21_hcd_init(void) -{ - return platform_driver_register(&imx21_hcd_driver); -} - -static void __exit imx21_hcd_cleanup(void) -{ - platform_driver_unregister(&imx21_hcd_driver); -} - -module_init(imx21_hcd_init); -module_exit(imx21_hcd_cleanup); +module_platform_driver(imx21_hcd_driver); MODULE_DESCRIPTION("i.MX21 USB Host controller"); MODULE_AUTHOR("Martin Fuzzey"); diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index dcd889803f0f..6f62de5c6e35 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c @@ -3951,24 +3951,7 @@ static struct platform_driver oxu_driver = { } }; -static int __init oxu_module_init(void) -{ - int retval = 0; - - retval = platform_driver_register(&oxu_driver); - if (retval < 0) - return retval; - - return retval; -} - -static void __exit oxu_module_cleanup(void) -{ - platform_driver_unregister(&oxu_driver); -} - -module_init(oxu_module_init); -module_exit(oxu_module_cleanup); +module_platform_driver(oxu_driver); MODULE_DESCRIPTION("Oxford OXU210HP HCD driver - ver. " DRIVER_VERSION); MODULE_AUTHOR("Rodolfo Giometti "); -- cgit v1.2.3