From: Tobias Klauser Date: Tue, 28 Feb 2012 11:57:23 +0000 (+0100) Subject: usb: sl811-hcd: Convert to module_platform_driver X-Git-Tag: v3.4-rc1~184^2~22^2~30 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6ef1a9276be455c114c000ef3d43666cb6ded371;p=karo-tx-linux.git usb: sl811-hcd: Convert to module_platform_driver Use the module_platform_driver macro, move the usb_disabled() check to the probe function and get rid of the rather pointless message on module load. Signed-off-by: Tobias Klauser Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 961d6638d8f9..2a2cce2d2fa7 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -1632,6 +1632,9 @@ sl811h_probe(struct platform_device *dev) u8 tmp, ioaddr = 0; unsigned long irqflags; + if (usb_disabled()) + return -ENODEV; + /* basic sanity checks first. board-specific init logic should * have initialized these three resources and probably board * specific platform_data. we don't probe for IRQs, and do only @@ -1817,20 +1820,4 @@ struct platform_driver sl811h_driver = { }; EXPORT_SYMBOL(sl811h_driver); -/*-------------------------------------------------------------------------*/ - -static int __init sl811h_init(void) -{ - if (usb_disabled()) - return -ENODEV; - - INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); - return platform_driver_register(&sl811h_driver); -} -module_init(sl811h_init); - -static void __exit sl811h_cleanup(void) -{ - platform_driver_unregister(&sl811h_driver); -} -module_exit(sl811h_cleanup); +module_platform_driver(sl811h_driver);