diff mbox

[v3,4/7] USB: EHCI: export ehci_shutdown

Message ID 1364507705-22012-5-git-send-email-arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann March 28, 2013, 9:55 p.m. UTC
The ehci_shutdown function is used by the platform specific ehci backends
for at91, tegra and ps3. In order to turn any of these into separate
modules, we need to make this function globally visible and export it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <greg@kroah.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/ehci-hcd.c | 3 ++-
 drivers/usb/host/ehci.h     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Alan Stern March 29, 2013, 7:56 p.m. UTC | #1
On Thu, 28 Mar 2013, Arnd Bergmann wrote:

> The ehci_shutdown function is used by the platform specific ehci backends
> for at91, tegra and ps3. In order to turn any of these into separate
> modules, we need to make this function globally visible and export it.

Actually, I think this is not necessary.  Instead those three glue
files ought to be changed.  They should not need to call
ehci_shutdown() directly.

The references to ehci_shutdown() in ehci-atmel.c and ehci-ps3.c seem
totally unnecesary.  That routine does a hard shutdown -- but the calls
are immediately followed by usb_remove_hcd(), which calls ehci_stop(),
which does an orderly shutdown followed by a reset.  While it certainly
would be good to check with the authors of these drivers, it would be
surprising if removing those calls led to any trouble.

The reference in ehci-tegra.c is there only so that
tegra_ehci_shutdown() can call tegra_ehci_power_up() before doing its
real work.  Instead, tegra_ehci_power_up() should be called by 
tegra_ehci_hcd_shutdown().  Then there would be no need to have the 
tegra_ehci_shutdown() routine at all.

Alan Stern
Geoff Levand March 30, 2013, 12:29 a.m. UTC | #2
Hi Alan,

> Actually, I think this is not necessary.  Instead those three glue
> files ought to be changed.  They should not need to call
> ehci_shutdown() directly.

I sent out a separate patch that removes the ehci_shutdown()
call in ps3_ehci_remove().  I tested it by removing and
installing the ehci_hcd module and it seems to work OK.

-Geoff
Alan Stern March 30, 2013, 1:36 a.m. UTC | #3
On Fri, 29 Mar 2013, Geoff Levand wrote:

> Hi Alan,
> 
> > Actually, I think this is not necessary.  Instead those three glue
> > files ought to be changed.  They should not need to call
> > ehci_shutdown() directly.
> 
> I sent out a separate patch that removes the ehci_shutdown()
> call in ps3_ehci_remove().  I tested it by removing and
> installing the ehci_hcd module and it seems to work OK.

Thanks!  I'll send it on up.

Alan Stern
diff mbox

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 8f1f4b4..1c9aa17 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -353,7 +353,7 @@  static void ehci_silence_controller(struct ehci_hcd *ehci)
  * This forcibly disables dma and IRQs, helping kexec and other cases
  * where the next system software may expect clean state.
  */
-static void ehci_shutdown(struct usb_hcd *hcd)
+void ehci_shutdown(struct usb_hcd *hcd)
 {
 	struct ehci_hcd	*ehci = hcd_to_ehci(hcd);
 
@@ -367,6 +367,7 @@  static void ehci_shutdown(struct usb_hcd *hcd)
 
 	hrtimer_cancel(&ehci->hrtimer);
 }
+EXPORT_SYMBOL_GPL(ehci_shutdown);
 
 /*-------------------------------------------------------------------------*/
 
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index e666999..915739d 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -799,6 +799,7 @@  struct ehci_driver_overrides {
 extern void	ehci_init_driver(struct hc_driver *drv,
 				const struct ehci_driver_overrides *over);
 extern int	ehci_setup(struct usb_hcd *hcd);
+extern void	ehci_shutdown(struct usb_hcd *hcd);
 
 #ifdef CONFIG_PM
 extern int	ehci_suspend(struct usb_hcd *hcd, bool do_wakeup);