LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Felipe Balbi <me@felipebalbi.com>
To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Cc: david-b@pacbell.net, tony@atomide.com, Felipe Balbi <me@felipebalbi.com>
Subject: [PATCH 2/4] USB: OTG: Make otg_get_transceiver() and otg_set_transceiver() generic
Date: Sat, 19 Jan 2008 16:37:23 +0200	[thread overview]
Message-ID: <1200753446-9378-3-git-send-email-me@felipebalbi.com> (raw)
In-Reply-To: <1200753446-9378-2-git-send-email-me@felipebalbi.com>

From: Tony Lidgren <tony@atomide.com>

Move otg_get_transceiver() and otg_set_transceiver() from omap specific code
to common otg.c so other upcoming drivers can share them.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <me@felipebalbi.com>
---
 arch/arm/plat-omap/usb.c |   32 --------------------------------
 drivers/usb/core/otg.c   |   20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 32 deletions(-)

diff --git a/drivers/usb/core/otg.c b/drivers/usb/core/otg.c
index 11967c0..531afa6 100644
--- a/drivers/usb/core/otg.c
+++ b/drivers/usb/core/otg.c
@@ -14,9 +14,29 @@
 #include <linux/byteorder/generic.h>
 #include <linux/gfp.h>
 #include <linux/usb.h>
+#include <linux/usb/otg.h>
 
 #include "otg_whitelist.h"
 
+static struct otg_transceiver *xceiv;
+
+int otg_set_transceiver(struct otg_transceiver *x)
+{
+	if (xceiv && x)
+		return -EBUSY;
+	xceiv = x;
+	return 0;
+}
+EXPORT_SYMBOL(otg_set_transceiver);
+
+struct otg_transceiver *otg_get_transceiver(void)
+{
+	if (xceiv)
+		get_device(xceiv->dev);
+	return xceiv;
+}
+EXPORT_SYMBOL(otg_get_transceiver);
+
 #ifdef	CONFIG_USB_OTG_WHITELIST
 
 /*
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
index a5aedf9..5cd39fa 100644
--- a/arch/arm/plat-omap/usb.c
+++ b/arch/arm/plat-omap/usb.c
@@ -76,38 +76,6 @@
 
 /*-------------------------------------------------------------------------*/
 
-#ifdef	CONFIG_ARCH_OMAP_OTG
-
-static struct otg_transceiver *xceiv;
-
-/**
- * otg_get_transceiver - find the (single) OTG transceiver driver
- *
- * Returns the transceiver driver, after getting a refcount to it; or
- * null if there is no such transceiver.  The caller is responsible for
- * releasing that count.
- */
-struct otg_transceiver *otg_get_transceiver(void)
-{
-	if (xceiv)
-		get_device(xceiv->dev);
-	return xceiv;
-}
-EXPORT_SYMBOL(otg_get_transceiver);
-
-int otg_set_transceiver(struct otg_transceiver *x)
-{
-	if (xceiv && x)
-		return -EBUSY;
-	xceiv = x;
-	return 0;
-}
-EXPORT_SYMBOL(otg_set_transceiver);
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-
 #if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP15XX)
 
 static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device)
-- 
1.5.4.rc3.24.gb53139


  reply	other threads:[~2008-01-19 14:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-19 14:37 [PATCH 0/4] USB OTG Targeted Peripheral List changes Felipe Balbi
2008-01-19 14:37 ` [PATCH 1/4] USB: OTG: Introduce new otg.c code Felipe Balbi
2008-01-19 14:37   ` Felipe Balbi [this message]
2008-01-19 14:37     ` [PATCH 3/4] USB: OTG: Start using new otg tpl Felipe Balbi
2008-01-19 14:37       ` [PATCH 4/4] USB: OTG: Add check for roothub initialization Felipe Balbi
2008-01-19 14:37         ` [PATCH] USB: OTG: Make otg_tpl come from platform_data Felipe Balbi
2008-08-25 13:35     ` [PATCH 2/4] USB: OTG: Make otg_get_transceiver() and otg_set_transceiver() generic pHilipp Zabel
2008-08-25 13:39       ` 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=1200753446-9378-3-git-send-email-me@felipebalbi.com \
    --to=me@felipebalbi.com \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tony@atomide.com \
    --subject='Re: [PATCH 2/4] USB: OTG: Make otg_get_transceiver() and otg_set_transceiver() generic' \
    /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

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).