linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Linux USB Mailing List
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Linux OMAP Mailing List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Subject: [PATCH 3/6] usb: gadget: omap_udc: let it work as a module
Date: Tue, 29 May 2012 15:15:58 +0300	[thread overview]
Message-ID: <1338293761-9457-4-git-send-email-balbi@ti.com> (raw)
In-Reply-To: <1338293761-9457-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>

this also helps removing a few lines of boilerplate
code.

Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
---
 drivers/usb/gadget/omap_udc.c |   23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index 5e7b891..814aafb 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2535,7 +2535,7 @@ static inline void remove_proc_file(void) {}
  * UDC_SYSCON_1.CFG_LOCK is set can now work.  We won't use that
  * capability yet though.
  */
-static unsigned __init
+static unsigned __devinit
 omap_ep_setup(char *name, u8 addr, u8 type,
 		unsigned buf, unsigned maxp, int dbuf)
 {
@@ -2653,7 +2653,7 @@ static void omap_udc_release(struct device *dev)
 	udc = NULL;
 }
 
-static int __init
+static int __devinit
 omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv)
 {
 	unsigned	tmp, buf;
@@ -2790,7 +2790,7 @@ omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv)
 	return 0;
 }
 
-static int __init omap_udc_probe(struct platform_device *pdev)
+static int __devinit omap_udc_probe(struct platform_device *pdev)
 {
 	int			status = -ENODEV;
 	int			hmc;
@@ -3003,7 +3003,7 @@ cleanup0:
 	return status;
 }
 
-static int __exit omap_udc_remove(struct platform_device *pdev)
+static int __devexit omap_udc_remove(struct platform_device *pdev)
 {
 	DECLARE_COMPLETION_ONSTACK(done);
 
@@ -3088,7 +3088,8 @@ static int omap_udc_resume(struct platform_device *dev)
 /*-------------------------------------------------------------------------*/
 
 static struct platform_driver udc_driver = {
-	.remove		= __exit_p(omap_udc_remove),
+	.probe		= omap_udc_probe,
+	.remove		= __devexit_p(omap_udc_remove),
 	.suspend	= omap_udc_suspend,
 	.resume		= omap_udc_resume,
 	.driver		= {
@@ -3097,17 +3098,7 @@ static struct platform_driver udc_driver = {
 	},
 };
 
-static int __init udc_init(void)
-{
-	return platform_driver_probe(&udc_driver, omap_udc_probe);
-}
-module_init(udc_init);

  parent reply	other threads:[~2012-05-29 12:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29 12:15 [PATCH 0/6] usb: gadget: omap_udc: cleanup patches Felipe Balbi
2012-05-29 12:15 ` [PATCH 1/6] usb: gadget: omap_udc: make checkpatch.pl happy Felipe Balbi
2012-05-29 12:15 ` [PATCH 2/6] usb: gadget: omap_udc: remove useless print Felipe Balbi
     [not found]   ` <1338293761-9457-3-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2012-06-01 11:01     ` Tony Lindgren
     [not found]       ` <20120601110123.GK12766-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2012-06-01 11:07         ` Felipe Balbi
2012-06-01 11:45           ` Tony Lindgren
     [not found] ` <1338293761-9457-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2012-05-29 12:15   ` Felipe Balbi [this message]
2012-05-29 12:15   ` [PATCH 4/6] usb: gadget: omap_udc: remove possiblity of NULL pointer de-reference Felipe Balbi
2012-05-29 12:16   ` [PATCH 5/6] usb: gadget: omap_udc: kfree(NULL) is safe Felipe Balbi
2012-05-29 12:16 ` [PATCH 6/6] usb: gadget: omap_udc: use generic map/unmap routines Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338293761-9457-4-git-send-email-balbi@ti.com \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).