usb: musb: Remove usb_disable() check in module_init()
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Thu, 26 Dec 2013 12:24:52 +0000 (09:24 -0300)
committerFelipe Balbi <balbi@ti.com>
Thu, 26 Dec 2013 16:17:40 +0000 (10:17 -0600)
Removing the check to usb_disable() before registering the platform
driver allows to build this driver when !USB && USB_GADGET, to be
used in gadget-only mode.

Also, use module_platform_driver() to register the platform driver.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_core.c

index 0e7f4a00ca7ba722a6099ee0c0206270eac0bbc5..5942f002fa52faa32f81b7c7dbc96ba08150e13d 100644 (file)
@@ -2325,19 +2325,4 @@ static struct platform_driver musb_driver = {
        .shutdown       = musb_shutdown,
 };
 
-/*-------------------------------------------------------------------------*/
-
-static int __init musb_init(void)
-{
-       if (usb_disabled())
-               return 0;
-
-       return platform_driver_register(&musb_driver);
-}
-module_init(musb_init);
-
-static void __exit musb_cleanup(void)
-{
-       platform_driver_unregister(&musb_driver);
-}
-module_exit(musb_cleanup);
+module_platform_driver(musb_driver);