Commit 467e1559 authored by David Brownell's avatar David Brownell Committed by Tony Lindgren

USB: Undefined usb_disconnect

Various fixes for the OHCI OMAP glue:

 - Properly use the usbcore HCD lifecycle entry points

 - Remove calls to non-exported usbcore routines.

 - Stop inappropriate export of some bus glue calls

Plus remove some extra whitespace.
parent 6bdebcf2
...@@ -183,13 +183,14 @@ static void start_hnp(struct ohci_hcd *ohci) ...@@ -183,13 +183,14 @@ static void start_hnp(struct ohci_hcd *ohci)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev) static int ohci_omap_init(struct usb_hcd *hcd)
{ {
struct omap_usb_config *config = pdev->dev.platform_data; struct ohci_hcd *ohci = hcd_to_ohci(hcd);
struct omap_usb_config *config = hcd->self.controller->platform_data;
int need_transceiver = (config->otg != 0); int need_transceiver = (config->otg != 0);
int ret; int ret;
dev_dbg(&pdev->dev, "starting USB Controller\n"); dev_dbg(hcd->self.controller, "starting USB Controller\n");
if (config->otg) { if (config->otg) {
ohci_to_hcd(ohci)->self.otg_port = config->otg; ohci_to_hcd(ohci)->self.otg_port = config->otg;
...@@ -210,7 +211,7 @@ static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev) ...@@ -210,7 +211,7 @@ static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev)
if (ohci->transceiver) { if (ohci->transceiver) {
int status = otg_set_host(ohci->transceiver, int status = otg_set_host(ohci->transceiver,
&ohci_to_hcd(ohci)->self); &ohci_to_hcd(ohci)->self);
dev_dbg(&pdev->dev, "init %s transceiver, status %d\n", dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
ohci->transceiver->label, status); ohci->transceiver->label, status);
if (status) { if (status) {
if (ohci->transceiver) if (ohci->transceiver)
...@@ -218,7 +219,7 @@ static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev) ...@@ -218,7 +219,7 @@ static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev)
return status; return status;
} }
} else { } else {
dev_err(&pdev->dev, "can't find transceiver\n"); dev_err(hcd->self.controller, "can't find transceiver\n");
return -ENODEV; return -ENODEV;
} }
} }
...@@ -274,17 +275,15 @@ static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev) ...@@ -274,17 +275,15 @@ static int omap_start_hc(struct ohci_hcd *ohci, struct platform_device *pdev)
return 0; return 0;
} }
static void omap_stop_hc(struct platform_device *pdev) static void ohci_omap_stop(struct usb_hcd *hcd)
{ {
dev_dbg(&pdev->dev, "stopping USB Controller\n"); dev_dbg(hcd->self.controller, "stopping USB Controller\n");
omap_ohci_clock_power(0); omap_ohci_clock_power(0);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
void usb_hcd_omap_remove (struct usb_hcd *, struct platform_device *);
/** /**
* usb_hcd_omap_probe - initialize OMAP-based HCDs * usb_hcd_omap_probe - initialize OMAP-based HCDs
* Context: !in_interrupt() * Context: !in_interrupt()
...@@ -293,7 +292,7 @@ void usb_hcd_omap_remove (struct usb_hcd *, struct platform_device *); ...@@ -293,7 +292,7 @@ void usb_hcd_omap_remove (struct usb_hcd *, struct platform_device *);
* then invokes the start() method for the HCD associated with it * then invokes the start() method for the HCD associated with it
* through the hotplug entry's driver_data. * through the hotplug entry's driver_data.
*/ */
int usb_hcd_omap_probe (const struct hc_driver *driver, static int usb_hcd_omap_probe (const struct hc_driver *driver,
struct platform_device *pdev) struct platform_device *pdev)
{ {
int retval, irq; int retval, irq;
...@@ -349,10 +348,6 @@ int usb_hcd_omap_probe (const struct hc_driver *driver, ...@@ -349,10 +348,6 @@ int usb_hcd_omap_probe (const struct hc_driver *driver,
host_initialized = 0; host_initialized = 0;
host_enabled = 1; host_enabled = 1;
retval = omap_start_hc(ohci, pdev);
if (retval < 0)
goto err2;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
retval = -ENXIO; retval = -ENXIO;
...@@ -360,7 +355,7 @@ int usb_hcd_omap_probe (const struct hc_driver *driver, ...@@ -360,7 +355,7 @@ int usb_hcd_omap_probe (const struct hc_driver *driver,
} }
retval = usb_add_hcd(hcd, irq, SA_INTERRUPT); retval = usb_add_hcd(hcd, irq, SA_INTERRUPT);
if (retval) if (retval)
goto err3; goto err2;
host_initialized = 1; host_initialized = 1;
...@@ -368,8 +363,6 @@ int usb_hcd_omap_probe (const struct hc_driver *driver, ...@@ -368,8 +363,6 @@ int usb_hcd_omap_probe (const struct hc_driver *driver,
omap_ohci_clock_power(0); omap_ohci_clock_power(0);
return 0; return 0;
err3:
omap_stop_hc(pdev);
err2: err2:
release_mem_region(hcd->rsrc_start, hcd->rsrc_len); release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
err1: err1:
...@@ -391,14 +384,19 @@ err0: ...@@ -391,14 +384,19 @@ err0:
* Reverses the effect of usb_hcd_omap_probe(), first invoking * Reverses the effect of usb_hcd_omap_probe(), first invoking
* the HCD's stop() method. It is always called from a thread * the HCD's stop() method. It is always called from a thread
* context, normally "rmmod", "apmd", or something similar. * context, normally "rmmod", "apmd", or something similar.
*
*/ */
void usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev) static inline void
usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
{ {
struct ohci_hcd *ohci = hcd_to_ohci (hcd);
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
if (ohci->transceiver) {
(void) otg_set_host(ohci->transceiver, 0);
put_device(ohci->transceiver->dev);
}
if (machine_is_omap_osk()) if (machine_is_omap_osk())
omap_free_gpio(9); omap_free_gpio(9);
omap_stop_hc(pdev);
release_mem_region(hcd->rsrc_start, hcd->rsrc_len); release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
usb_put_hcd(hcd); usb_put_hcd(hcd);
clk_put(usb_dc_ck); clk_put(usb_dc_ck);
...@@ -444,8 +442,9 @@ static const struct hc_driver ohci_omap_hc_driver = { ...@@ -444,8 +442,9 @@ static const struct hc_driver ohci_omap_hc_driver = {
/* /*
* basic lifecycle operations * basic lifecycle operations
*/ */
.reset = ohci_omap_init,
.start = ohci_omap_start, .start = ohci_omap_start,
.stop = ohci_stop, .stop = ohci_omap_stop,
/* /*
* managing i/o requests and associated device resources * managing i/o requests and associated device resources
...@@ -481,13 +480,8 @@ static int ohci_hcd_omap_drv_probe(struct platform_device *dev) ...@@ -481,13 +480,8 @@ static int ohci_hcd_omap_drv_probe(struct platform_device *dev)
static int ohci_hcd_omap_drv_remove(struct platform_device *dev) static int ohci_hcd_omap_drv_remove(struct platform_device *dev)
{ {
struct usb_hcd *hcd = platform_get_drvdata(dev); struct usb_hcd *hcd = platform_get_drvdata(dev);
struct ohci_hcd *ohci = hcd_to_ohci (hcd);
usb_hcd_omap_remove(hcd, dev); usb_hcd_omap_remove(hcd, dev);
if (ohci->transceiver) {
(void) otg_set_host(ohci->transceiver, 0);
put_device(ohci->transceiver->dev);
}
platform_set_drvdata(dev, NULL); platform_set_drvdata(dev, NULL);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment