From patchwork Wed Jan 9 11:15:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 1952081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 5A424DF25A for ; Wed, 9 Jan 2013 11:19:06 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tstdp-0005KG-LT; Wed, 09 Jan 2013 11:16:17 +0000 Received: from mail-bk0-f47.google.com ([209.85.214.47]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TstdF-0005Ar-Ja for linux-arm-kernel@lists.infradead.org; Wed, 09 Jan 2013 11:15:44 +0000 Received: by mail-bk0-f47.google.com with SMTP id j4so819267bkw.34 for ; Wed, 09 Jan 2013 03:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=uz1RTW0QtwE5uHmA+JzRHnxbQYyrXYvMa5ItzshurCI=; b=iUeShW9nzsP2I7CQvAoX6/tHsixVTwoqATRg0pHvfCb4M1vWyR2Ufb4+fsI3+B6GhK xrBDAB0Z1+ikQ9sCyqye8EceKhqdr9oh8ysxArnmsG8VDSoAmrft5oMUZW+zC8sGtpA2 OUxJzH1MgTKsOKYwbjXLNi7NvRhRKaxVzG9/wcJP8970auwfJCtZyqWPQVPMwtXgx8Yj pg77JNDNMMHGb4ETBA903aXm6iih9AefIOSS0a36uobOfxvfQ6IvNgYTlv9kxoo0AvPB HHl6eIH4ZtRgb4FwsotVyFWZBJKDlBMT0Wt0NudQLpH44WBzwA/BxkPtnCnbKyKBy+FC ftEQ== X-Received: by 10.204.143.147 with SMTP id v19mr32764005bku.32.1357730139384; Wed, 09 Jan 2013 03:15:39 -0800 (PST) Received: from ld2036.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPS id hm8sm48220416bkc.10.2013.01.09.03.15.36 (version=SSLv3 cipher=OTHER); Wed, 09 Jan 2013 03:15:38 -0800 (PST) From: Fabio Porcedda To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 3/3] usb: converto drivers/usb/* to use module_platform_driver_probe() Date: Wed, 9 Jan 2013 12:15:28 +0100 Message-Id: <1357730128-23018-4-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 1.8.0.3 In-Reply-To: <1357730128-23018-1-git-send-email-fabio.porcedda@gmail.com> References: <1357730128-23018-1-git-send-email-fabio.porcedda@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130109_061542_685454_C8E178E1 X-CRM114-Status: GOOD ( 14.10 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.47 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (fabio.porcedda[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Eric Miao , Greg Kroah-Hartman , Nicolas Ferre , Haojian Zhuang , Felipe Balbi , Russell King X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch converts the drivers in drivers/usb/* to use the module_platform_driver_probe() macro which makes the code smaller and a bit simpler. Signed-off-by: Fabio Porcedda Cc: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman Cc: Felipe Balbi Cc: Nicolas Ferre Cc: Eric Miao Cc: Russell King Cc: Haojian Zhuang --- drivers/usb/gadget/at91_udc.c | 12 +----------- drivers/usb/gadget/atmel_usba_udc.c | 12 +----------- drivers/usb/gadget/fusb300_udc.c | 13 +------------ drivers/usb/gadget/imx_udc.c | 12 +----------- drivers/usb/gadget/lpc32xx_udc.c | 12 +----------- drivers/usb/gadget/m66592-udc.c | 12 +----------- drivers/usb/gadget/pxa25x_udc.c | 15 +++------------ drivers/usb/gadget/r8a66597-udc.c | 15 ++------------- drivers/usb/otg/gpio_vbus.c | 12 +----------- drivers/usb/otg/msm_otg.c | 13 +------------ 10 files changed, 13 insertions(+), 115 deletions(-) diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index f4a21f6..0143ffa 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1982,17 +1982,7 @@ static struct platform_driver at91_udc_driver = { }, }; -static int __init udc_init_module(void) -{ - return platform_driver_probe(&at91_udc_driver, at91udc_probe); -} -module_init(udc_init_module); - -static void __exit udc_exit_module(void) -{ - platform_driver_unregister(&at91_udc_driver); -} -module_exit(udc_exit_module); +module_platform_driver_probe(at91_udc_driver, at91udc_probe); MODULE_DESCRIPTION("AT91 udc driver"); MODULE_AUTHOR("Thomas Rathbone, David Brownell"); diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index a7aed84..bc19496 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -2066,17 +2066,7 @@ static struct platform_driver udc_driver = { }, }; -static int __init udc_init(void) -{ - return platform_driver_probe(&udc_driver, usba_udc_probe); -} -module_init(udc_init); - -static void __exit udc_exit(void) -{ - platform_driver_unregister(&udc_driver); -} -module_exit(udc_exit); +module_platform_driver_probe(udc_driver, usba_udc_probe); MODULE_DESCRIPTION("Atmel USBA UDC driver"); MODULE_AUTHOR("Haavard Skinnemoen (Atmel)"); diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c index 72cd5e6..fc7cb09 100644 --- a/drivers/usb/gadget/fusb300_udc.c +++ b/drivers/usb/gadget/fusb300_udc.c @@ -1547,15 +1547,4 @@ static struct platform_driver fusb300_driver = { }, }; -static int __init fusb300_udc_init(void) -{ - return platform_driver_probe(&fusb300_driver, fusb300_probe); -} - -module_init(fusb300_udc_init); - -static void __exit fusb300_udc_cleanup(void) -{ - platform_driver_unregister(&fusb300_driver); -} -module_exit(fusb300_udc_cleanup); +module_platform_driver_probe(fusb300_driver, fusb300_probe); diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c index a0eb857..8efd755 100644 --- a/drivers/usb/gadget/imx_udc.c +++ b/drivers/usb/gadget/imx_udc.c @@ -1556,17 +1556,7 @@ static struct platform_driver udc_driver = { .resume = imx_udc_resume, }; -static int __init udc_init(void) -{ - return platform_driver_probe(&udc_driver, imx_udc_probe); -} -module_init(udc_init); - -static void __exit udc_exit(void) -{ - platform_driver_unregister(&udc_driver); -} -module_exit(udc_exit); +module_platform_driver_probe(udc_driver, imx_udc_probe); MODULE_DESCRIPTION("IMX USB Device Controller driver"); MODULE_AUTHOR("Darius Augulis "); diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c index dd1c9b1..aa04089 100644 --- a/drivers/usb/gadget/lpc32xx_udc.c +++ b/drivers/usb/gadget/lpc32xx_udc.c @@ -3458,17 +3458,7 @@ static struct platform_driver lpc32xx_udc_driver = { }, }; -static int __init udc_init_module(void) -{ - return platform_driver_probe(&lpc32xx_udc_driver, lpc32xx_udc_probe); -} -module_init(udc_init_module); - -static void __exit udc_exit_module(void) -{ - platform_driver_unregister(&lpc32xx_udc_driver); -} -module_exit(udc_exit_module); +module_platform_driver_probe(lpc32xx_udc_driver, lpc32xx_udc_probe); MODULE_DESCRIPTION("LPC32XX udc driver"); MODULE_AUTHOR("Kevin Wells "); diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index b6401f1..dfce0cf 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c @@ -1753,14 +1753,4 @@ static struct platform_driver m66592_driver = { }, }; -static int __init m66592_udc_init(void) -{ - return platform_driver_probe(&m66592_driver, m66592_probe); -} -module_init(m66592_udc_init); - -static void __exit m66592_udc_cleanup(void) -{ - platform_driver_unregister(&m66592_driver); -} -module_exit(m66592_udc_cleanup); +module_platform_driver_probe(m66592_driver, m66592_probe); diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index d4ca9f1..d52e869 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c @@ -2100,6 +2100,8 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev) int retval, irq; u32 chiprev; + pr_info("%s: version %s\n", driver_name, DRIVER_VERSION); + /* insist on Intel/ARM/XScale */ asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev)); if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) { @@ -2346,18 +2348,7 @@ static struct platform_driver udc_driver = { }, }; -static int __init udc_init(void) -{ - pr_info("%s: version %s\n", driver_name, DRIVER_VERSION); - return platform_driver_probe(&udc_driver, pxa25x_udc_probe); -} -module_init(udc_init); - -static void __exit udc_exit(void) -{ - platform_driver_unregister(&udc_driver); -} -module_exit(udc_exit); +module_platform_driver_probe(udc_driver, pxa25x_udc_probe); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell"); diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 5a80751..9a9fadd 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c @@ -2031,21 +2031,10 @@ static struct platform_driver r8a66597_driver = { .name = (char *) udc_name, }, }; -MODULE_ALIAS("platform:r8a66597_udc"); - -static int __init r8a66597_udc_init(void) -{ - return platform_driver_probe(&r8a66597_driver, r8a66597_probe); -} -module_init(r8a66597_udc_init); -static void __exit r8a66597_udc_cleanup(void) -{ - platform_driver_unregister(&r8a66597_driver); -} -module_exit(r8a66597_udc_cleanup); +module_platform_driver_probe(r8a66597_driver, r8a66597_probe); MODULE_DESCRIPTION("R8A66597 USB gadget driver"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Yoshihiro Shimoda"); - +MODULE_ALIAS("platform:r8a66597_udc"); diff --git a/drivers/usb/otg/gpio_vbus.c b/drivers/usb/otg/gpio_vbus.c index a67ffe2..a7d4ac5 100644 --- a/drivers/usb/otg/gpio_vbus.c +++ b/drivers/usb/otg/gpio_vbus.c @@ -409,17 +409,7 @@ static struct platform_driver gpio_vbus_driver = { .remove = __exit_p(gpio_vbus_remove), }; -static int __init gpio_vbus_init(void) -{ - return platform_driver_probe(&gpio_vbus_driver, gpio_vbus_probe); -} -module_init(gpio_vbus_init); - -static void __exit gpio_vbus_exit(void) -{ - platform_driver_unregister(&gpio_vbus_driver); -} -module_exit(gpio_vbus_exit); +module_platform_driver_probe(gpio_vbus_driver, gpio_vbus_probe); MODULE_DESCRIPTION("simple GPIO controlled OTG transceiver driver"); MODULE_AUTHOR("Philipp Zabel"); diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c index 3b9f0d9..749fbf4 100644 --- a/drivers/usb/otg/msm_otg.c +++ b/drivers/usb/otg/msm_otg.c @@ -1756,18 +1756,7 @@ static struct platform_driver msm_otg_driver = { }, }; -static int __init msm_otg_init(void) -{ - return platform_driver_probe(&msm_otg_driver, msm_otg_probe); -} - -static void __exit msm_otg_exit(void) -{ - platform_driver_unregister(&msm_otg_driver); -} - -module_init(msm_otg_init); -module_exit(msm_otg_exit); +module_platform_driver_probe(msm_otg_driver, msm_otg_probe); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("MSM USB transceiver driver");