* [PATCH 0/5] SA1111 USB cleanups
@ 2012-02-03 20:04 Russell King - ARM Linux
2012-02-03 20:09 ` [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups Russell King - ARM Linux
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 20:04 UTC (permalink / raw)
To: linux-arm-kernel
This is the final set for this evening; this is a smaller set of cleanups
and updates for the SA1111 OHCI driver. This series depends on the
SA1111 patch series.
One of the things it completes is the work in 64a21d025d3 (USB: Properly
unregister reboot notifier in case of failure in ehci hcd) by adding
the shutdown methods. (That commit notes that it omitted SA1111 due to
no shutdown callback. And there is now.)
drivers/usb/host/ohci-sa1111.c | 244 ++++++++++++++++++----------------------
1 files changed, 108 insertions(+), 136 deletions(-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups
2012-02-03 20:04 [PATCH 0/5] SA1111 USB cleanups Russell King - ARM Linux
@ 2012-02-03 20:09 ` Russell King - ARM Linux
2012-02-03 20:32 ` Greg KH
2012-02-03 20:09 ` [PATCH 2/5] USB: sa1111: get rid of nasty printk(KERN_DEBUG "%s: ...", __FILE__) Russell King - ARM Linux
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 20:09 UTC (permalink / raw)
To: linux-arm-kernel
Clean up the ohci-sa1111 driver formatting to be more compliant with
current standards, and add 'static' to various function definitions
to avoid sparse complaints about undeclared functions. Remove the
unnecessary local declaration of 'usb_disabled', which can be found
instead in linux/usb.h.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/usb/host/ohci-sa1111.c | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c
index 585e53e..50ebeb3 100644
--- a/drivers/usb/host/ohci-sa1111.c
+++ b/drivers/usb/host/ohci-sa1111.c
@@ -41,8 +41,6 @@
#define USB_STATUS_NHCIMFCLR (1 << 10)
#define USB_STATUS_USBPWRSENSE (1 << 11)
-extern int usb_disabled(void);
-
/*-------------------------------------------------------------------------*/
static int sa1111_start_hc(struct sa1111_dev *dev)
@@ -82,6 +80,7 @@ static int sa1111_start_hc(struct sa1111_dev *dev)
static void sa1111_stop_hc(struct sa1111_dev *dev)
{
unsigned int usb_rst;
+
printk(KERN_DEBUG "%s: stopping SA-1111 OHCI USB Controller\n",
__FILE__);
@@ -106,7 +105,7 @@ static void dump_hci_status(struct usb_hcd *hcd, const char *label)
{
unsigned long status = sa1111_readl(hcd->regs + USB_STATUS);
- dbg ("%s USB_STATUS = { %s%s%s%s%s}", label,
+ dbg("%s USB_STATUS = { %s%s%s%s%s}", label,
((status & USB_STATUS_IRQHCIRMTWKUP) ? "IRQHCIRMTWKUP " : ""),
((status & USB_STATUS_IRQHCIBUFFACC) ? "IRQHCIBUFFACC " : ""),
((status & USB_STATUS_NIRQHCIM) ? "" : "IRQHCIM "),
@@ -131,15 +130,16 @@ static void dump_hci_status(struct usb_hcd *hcd, const char *label)
*
* Store this function in the HCD's struct pci_driver as probe().
*/
-int usb_hcd_sa1111_probe (const struct hc_driver *driver,
- struct sa1111_dev *dev)
+static int usb_hcd_sa1111_probe(const struct hc_driver *driver,
+ struct sa1111_dev *dev)
{
struct usb_hcd *hcd;
int retval;
- hcd = usb_create_hcd (driver, &dev->dev, "sa1111");
+ hcd = usb_create_hcd(driver, &dev->dev, "sa1111");
if (!hcd)
return -ENOMEM;
+
hcd->rsrc_start = dev->res.start;
hcd->rsrc_len = resource_size(&dev->res);
@@ -148,6 +148,7 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver,
retval = -EBUSY;
goto err1;
}
+
hcd->regs = dev->mapbase;
ret = sa1111_start_hc(dev);
@@ -180,9 +181,8 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver,
* Reverses the effect of usb_hcd_sa1111_probe(), first invoking
* the HCD's stop() method. It is always called from a thread
* context, normally "rmmod", "apmd", or something similar.
- *
*/
-void usb_hcd_sa1111_remove (struct usb_hcd *hcd, struct sa1111_dev *dev)
+static void usb_hcd_sa1111_remove(struct usb_hcd *hcd, struct sa1111_dev *dev)
{
usb_remove_hcd(hcd);
sa1111_stop_hc(dev);
@@ -192,18 +192,19 @@ void usb_hcd_sa1111_remove (struct usb_hcd *hcd, struct sa1111_dev *dev)
/*-------------------------------------------------------------------------*/
-static int __devinit
-ohci_sa1111_start (struct usb_hcd *hcd)
+static int __devinit ohci_sa1111_start(struct usb_hcd *hcd)
{
- struct ohci_hcd *ohci = hcd_to_ohci (hcd);
- int ret;
+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+ int ret;
- if ((ret = ohci_init(ohci)) < 0)
+ ret = ohci_init(ohci);
+ if (ret < 0)
return ret;
- if ((ret = ohci_run (ohci)) < 0) {
- err ("can't start %s", hcd->self.bus_name);
- ohci_stop (hcd);
+ ret = ohci_run(ohci);
+ if (ret < 0) {
+ err("can't start %s", hcd->self.bus_name);
+ ohci_stop(hcd);
return ret;
}
return 0;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/5] USB: sa1111: get rid of nasty printk(KERN_DEBUG "%s: ...", __FILE__)
2012-02-03 20:04 [PATCH 0/5] SA1111 USB cleanups Russell King - ARM Linux
2012-02-03 20:09 ` [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups Russell King - ARM Linux
@ 2012-02-03 20:09 ` Russell King - ARM Linux
2012-02-03 20:09 ` [PATCH 3/5] USB: sa1111: reorganize ohci-sa1111.c Russell King - ARM Linux
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 20:09 UTC (permalink / raw)
To: linux-arm-kernel
Use dev_dbg() instead, it's more friendly.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/usb/host/ohci-sa1111.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c
index 50ebeb3..e797f18 100644
--- a/drivers/usb/host/ohci-sa1111.c
+++ b/drivers/usb/host/ohci-sa1111.c
@@ -48,8 +48,7 @@ static int sa1111_start_hc(struct sa1111_dev *dev)
unsigned int usb_rst = 0;
int ret;
- printk(KERN_DEBUG "%s: starting SA-1111 OHCI USB Controller\n",
- __FILE__);
+ dev_dbg(&dev->dev, "starting SA-1111 OHCI USB Controller\n");
if (machine_is_xp860() ||
machine_has_neponset() ||
@@ -81,8 +80,7 @@ static void sa1111_stop_hc(struct sa1111_dev *dev)
{
unsigned int usb_rst;
- printk(KERN_DEBUG "%s: stopping SA-1111 OHCI USB Controller\n",
- __FILE__);
+ dev_dbg(&dev->dev, "stopping SA-1111 OHCI USB Controller\n");
/*
* Put the USB host controller into reset.
--
1.7.4.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/5] USB: sa1111: reorganize ohci-sa1111.c
2012-02-03 20:04 [PATCH 0/5] SA1111 USB cleanups Russell King - ARM Linux
2012-02-03 20:09 ` [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups Russell King - ARM Linux
2012-02-03 20:09 ` [PATCH 2/5] USB: sa1111: get rid of nasty printk(KERN_DEBUG "%s: ...", __FILE__) Russell King - ARM Linux
@ 2012-02-03 20:09 ` Russell King - ARM Linux
2012-02-03 20:10 ` [PATCH 4/5] USB: sa1111: add OHCI shutdown methods Russell King - ARM Linux
2012-02-03 20:10 ` [PATCH 5/5] USB: sa1111: add hcd .reset method Russell King - ARM Linux
4 siblings, 0 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 20:09 UTC (permalink / raw)
To: linux-arm-kernel
Combine usb_hcd_sa1111_probe() and ohci_hcd_sa1111_drv_probe(), doing
the same for the remove methods.
Move sa1111_start_hc and sa1111_stop_hc to be located next to these
the probe/release functions, as they're only called from them.
Get rid of the /*----*/ breaker lines.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/usb/host/ohci-sa1111.c | 227 ++++++++++++++++-----------------------
1 files changed, 93 insertions(+), 134 deletions(-)
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c
index e797f18..83f3a40 100644
--- a/drivers/usb/host/ohci-sa1111.c
+++ b/drivers/usb/host/ohci-sa1111.c
@@ -41,7 +41,78 @@
#define USB_STATUS_NHCIMFCLR (1 << 10)
#define USB_STATUS_USBPWRSENSE (1 << 11)
-/*-------------------------------------------------------------------------*/
+#if 0
+static void dump_hci_status(struct usb_hcd *hcd, const char *label)
+{
+ unsigned long status = sa1111_readl(hcd->regs + USB_STATUS);
+
+ dbg("%s USB_STATUS = { %s%s%s%s%s}", label,
+ ((status & USB_STATUS_IRQHCIRMTWKUP) ? "IRQHCIRMTWKUP " : ""),
+ ((status & USB_STATUS_IRQHCIBUFFACC) ? "IRQHCIBUFFACC " : ""),
+ ((status & USB_STATUS_NIRQHCIM) ? "" : "IRQHCIM "),
+ ((status & USB_STATUS_NHCIMFCLR) ? "" : "HCIMFCLR "),
+ ((status & USB_STATUS_USBPWRSENSE) ? "USBPWRSENSE " : ""));
+}
+#endif
+
+static int __devinit ohci_sa1111_start(struct usb_hcd *hcd)
+{
+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+ int ret;
+
+ ret = ohci_init(ohci);
+ if (ret < 0)
+ return ret;
+
+ ret = ohci_run(ohci);
+ if (ret < 0) {
+ err("can't start %s", hcd->self.bus_name);
+ ohci_stop(hcd);
+ return ret;
+ }
+ return 0;
+}
+
+static const struct hc_driver ohci_sa1111_hc_driver = {
+ .description = hcd_name,
+ .product_desc = "SA-1111 OHCI",
+ .hcd_priv_size = sizeof(struct ohci_hcd),
+
+ /*
+ * generic hardware linkage
+ */
+ .irq = ohci_irq,
+ .flags = HCD_USB11 | HCD_MEMORY,
+
+ /*
+ * basic lifecycle operations
+ */
+ .start = ohci_sa1111_start,
+ .stop = ohci_stop,
+
+ /*
+ * managing i/o requests and associated device resources
+ */
+ .urb_enqueue = ohci_urb_enqueue,
+ .urb_dequeue = ohci_urb_dequeue,
+ .endpoint_disable = ohci_endpoint_disable,
+
+ /*
+ * scheduling support
+ */
+ .get_frame_number = ohci_get_frame,
+
+ /*
+ * root hub support
+ */
+ .hub_status_data = ohci_hub_status_data,
+ .hub_control = ohci_hub_control,
+#ifdef CONFIG_PM
+ .bus_suspend = ohci_bus_suspend,
+ .bus_resume = ohci_bus_resume,
+#endif
+ .start_port_reset = ohci_start_port_reset,
+};
static int sa1111_start_hc(struct sa1111_dev *dev)
{
@@ -95,46 +166,21 @@ static void sa1111_stop_hc(struct sa1111_dev *dev)
sa1111_disable_device(dev);
}
-
-/*-------------------------------------------------------------------------*/
-
-#if 0
-static void dump_hci_status(struct usb_hcd *hcd, const char *label)
-{
- unsigned long status = sa1111_readl(hcd->regs + USB_STATUS);
-
- dbg("%s USB_STATUS = { %s%s%s%s%s}", label,
- ((status & USB_STATUS_IRQHCIRMTWKUP) ? "IRQHCIRMTWKUP " : ""),
- ((status & USB_STATUS_IRQHCIBUFFACC) ? "IRQHCIBUFFACC " : ""),
- ((status & USB_STATUS_NIRQHCIM) ? "" : "IRQHCIM "),
- ((status & USB_STATUS_NHCIMFCLR) ? "" : "HCIMFCLR "),
- ((status & USB_STATUS_USBPWRSENSE) ? "USBPWRSENSE " : ""));
-}
-#endif
-
-/*-------------------------------------------------------------------------*/
-
-/* configure so an HC device and id are always provided */
-/* always called with process context; sleeping is OK */
-
-
/**
- * usb_hcd_sa1111_probe - initialize SA-1111-based HCDs
- * Context: !in_interrupt()
+ * ohci_hcd_sa1111_probe - initialize SA-1111-based HCDs
*
* Allocates basic resources for this USB host controller, and
- * then invokes the start() method for the HCD associated with it
- * through the hotplug entry's driver_data.
- *
- * Store this function in the HCD's struct pci_driver as probe().
+ * then invokes the start() method for the HCD associated with it.
*/
-static int usb_hcd_sa1111_probe(const struct hc_driver *driver,
- struct sa1111_dev *dev)
+static int ohci_hcd_sa1111_probe(struct sa1111_dev *dev)
{
struct usb_hcd *hcd;
- int retval;
+ int ret;
+
+ if (usb_disabled())
+ return -ENODEV;
- hcd = usb_create_hcd(driver, &dev->dev, "sa1111");
+ hcd = usb_create_hcd(&ohci_sa1111_hc_driver, &dev->dev, "sa1111");
if (!hcd)
return -ENOMEM;
@@ -143,7 +189,7 @@ static int usb_hcd_sa1111_probe(const struct hc_driver *driver,
if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
dbg("request_mem_region failed");
- retval = -EBUSY;
+ ret = -EBUSY;
goto err1;
}
@@ -155,120 +201,34 @@ static int usb_hcd_sa1111_probe(const struct hc_driver *driver,
ohci_hcd_init(hcd_to_ohci(hcd));
- retval = usb_add_hcd(hcd, dev->irq[1], 0);
- if (retval == 0)
- return retval;
+ ret = usb_add_hcd(hcd, dev->irq[1], 0);
+ if (ret == 0)
+ return ret;
sa1111_stop_hc(dev);
err2:
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
err1:
usb_put_hcd(hcd);
- return retval;
+ return ret;
}
-
-/* may be called without controller electrically present */
-/* may be called with controller, bus, and devices active */
-
/**
- * usb_hcd_sa1111_remove - shutdown processing for SA-1111-based HCDs
+ * ohci_hcd_sa1111_remove - shutdown processing for SA-1111-based HCDs
* @dev: USB Host Controller being removed
- * Context: !in_interrupt()
*
- * Reverses the effect of usb_hcd_sa1111_probe(), first invoking
- * the HCD's stop() method. It is always called from a thread
- * context, normally "rmmod", "apmd", or something similar.
+ * Reverses the effect of ohci_hcd_sa1111_probe(), first invoking
+ * the HCD's stop() method.
*/
-static void usb_hcd_sa1111_remove(struct usb_hcd *hcd, struct sa1111_dev *dev)
+static int ohci_hcd_sa1111_remove(struct sa1111_dev *dev)
{
+ struct usb_hcd *hcd = sa1111_get_drvdata(dev);
+
usb_remove_hcd(hcd);
sa1111_stop_hc(dev);
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
usb_put_hcd(hcd);
-}
-
-/*-------------------------------------------------------------------------*/
-static int __devinit ohci_sa1111_start(struct usb_hcd *hcd)
-{
- struct ohci_hcd *ohci = hcd_to_ohci(hcd);
- int ret;
-
- ret = ohci_init(ohci);
- if (ret < 0)
- return ret;
-
- ret = ohci_run(ohci);
- if (ret < 0) {
- err("can't start %s", hcd->self.bus_name);
- ohci_stop(hcd);
- return ret;
- }
- return 0;
-}
-
-/*-------------------------------------------------------------------------*/
-
-static const struct hc_driver ohci_sa1111_hc_driver = {
- .description = hcd_name,
- .product_desc = "SA-1111 OHCI",
- .hcd_priv_size = sizeof(struct ohci_hcd),
-
- /*
- * generic hardware linkage
- */
- .irq = ohci_irq,
- .flags = HCD_USB11 | HCD_MEMORY,
-
- /*
- * basic lifecycle operations
- */
- .start = ohci_sa1111_start,
- .stop = ohci_stop,
-
- /*
- * managing i/o requests and associated device resources
- */
- .urb_enqueue = ohci_urb_enqueue,
- .urb_dequeue = ohci_urb_dequeue,
- .endpoint_disable = ohci_endpoint_disable,
-
- /*
- * scheduling support
- */
- .get_frame_number = ohci_get_frame,
-
- /*
- * root hub support
- */
- .hub_status_data = ohci_hub_status_data,
- .hub_control = ohci_hub_control,
-#ifdef CONFIG_PM
- .bus_suspend = ohci_bus_suspend,
- .bus_resume = ohci_bus_resume,
-#endif
- .start_port_reset = ohci_start_port_reset,
-};
-
-/*-------------------------------------------------------------------------*/
-
-static int ohci_hcd_sa1111_drv_probe(struct sa1111_dev *dev)
-{
- int ret;
-
- if (usb_disabled())
- return -ENODEV;
-
- ret = usb_hcd_sa1111_probe(&ohci_sa1111_hc_driver, dev);
- return ret;
-}
-
-static int ohci_hcd_sa1111_drv_remove(struct sa1111_dev *dev)
-{
- struct usb_hcd *hcd = sa1111_get_drvdata(dev);
-
- usb_hcd_sa1111_remove(hcd, dev);
return 0;
}
@@ -278,7 +238,6 @@ static struct sa1111_driver ohci_hcd_sa1111_driver = {
.owner = THIS_MODULE,
},
.devid = SA1111_DEVID_USB,
- .probe = ohci_hcd_sa1111_drv_probe,
- .remove = ohci_hcd_sa1111_drv_remove,
+ .probe = ohci_hcd_sa1111_probe,
+ .remove = ohci_hcd_sa1111_remove,
};
-
--
1.7.4.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/5] USB: sa1111: add OHCI shutdown methods
2012-02-03 20:04 [PATCH 0/5] SA1111 USB cleanups Russell King - ARM Linux
` (2 preceding siblings ...)
2012-02-03 20:09 ` [PATCH 3/5] USB: sa1111: reorganize ohci-sa1111.c Russell King - ARM Linux
@ 2012-02-03 20:10 ` Russell King - ARM Linux
2012-02-03 20:10 ` [PATCH 5/5] USB: sa1111: add hcd .reset method Russell King - ARM Linux
4 siblings, 0 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 20:10 UTC (permalink / raw)
To: linux-arm-kernel
Add OHCI shutdown methods to cleanly shutdown the OHCI controller on
system shutdowns and reboots. This avoids the controller continuing
to run should be soft-reboot the platform, potentially scribbling
over system memory.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/usb/host/ohci-sa1111.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c
index 83f3a40..95c3f0f 100644
--- a/drivers/usb/host/ohci-sa1111.c
+++ b/drivers/usb/host/ohci-sa1111.c
@@ -89,6 +89,7 @@ static const struct hc_driver ohci_sa1111_hc_driver = {
*/
.start = ohci_sa1111_start,
.stop = ohci_stop,
+ .shutdown = ohci_shutdown,
/*
* managing i/o requests and associated device resources
@@ -232,6 +233,16 @@ static int ohci_hcd_sa1111_remove(struct sa1111_dev *dev)
return 0;
}
+static void ohci_hcd_sa1111_shutdown(struct sa1111_dev *dev)
+{
+ struct usb_hcd *hcd = sa1111_get_drvdata(dev);
+
+ if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
+ hcd->driver->shutdown(hcd);
+ sa1111_stop_hc(dev);
+ }
+}
+
static struct sa1111_driver ohci_hcd_sa1111_driver = {
.drv = {
.name = "sa1111-ohci",
@@ -240,4 +251,5 @@ static struct sa1111_driver ohci_hcd_sa1111_driver = {
.devid = SA1111_DEVID_USB,
.probe = ohci_hcd_sa1111_probe,
.remove = ohci_hcd_sa1111_remove,
+ .shutdown = ohci_hcd_sa1111_shutdown,
};
--
1.7.4.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/5] USB: sa1111: add hcd .reset method
2012-02-03 20:04 [PATCH 0/5] SA1111 USB cleanups Russell King - ARM Linux
` (3 preceding siblings ...)
2012-02-03 20:10 ` [PATCH 4/5] USB: sa1111: add OHCI shutdown methods Russell King - ARM Linux
@ 2012-02-03 20:10 ` Russell King - ARM Linux
4 siblings, 0 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 20:10 UTC (permalink / raw)
To: linux-arm-kernel
Add the .reset method to the HCD, and update the .start method
accordingly for this change.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/usb/host/ohci-sa1111.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c
index 95c3f0f..e1004fb 100644
--- a/drivers/usb/host/ohci-sa1111.c
+++ b/drivers/usb/host/ohci-sa1111.c
@@ -55,22 +55,25 @@ static void dump_hci_status(struct usb_hcd *hcd, const char *label)
}
#endif
+static int ohci_sa1111_reset(struct usb_hcd *hcd)
+{
+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+
+ ohci_hcd_init(ohci);
+ return ohci_init(ohci);
+}
+
static int __devinit ohci_sa1111_start(struct usb_hcd *hcd)
{
struct ohci_hcd *ohci = hcd_to_ohci(hcd);
int ret;
- ret = ohci_init(ohci);
- if (ret < 0)
- return ret;
-
ret = ohci_run(ohci);
if (ret < 0) {
- err("can't start %s", hcd->self.bus_name);
+ ohci_err(ohci, "can't start\n");
ohci_stop(hcd);
- return ret;
}
- return 0;
+ return ret;
}
static const struct hc_driver ohci_sa1111_hc_driver = {
@@ -87,6 +90,7 @@ static const struct hc_driver ohci_sa1111_hc_driver = {
/*
* basic lifecycle operations
*/
+ .reset = ohci_sa1111_reset,
.start = ohci_sa1111_start,
.stop = ohci_stop,
.shutdown = ohci_shutdown,
@@ -200,8 +204,6 @@ static int ohci_hcd_sa1111_probe(struct sa1111_dev *dev)
if (ret)
goto err2;
- ohci_hcd_init(hcd_to_ohci(hcd));
-
ret = usb_add_hcd(hcd, dev->irq[1], 0);
if (ret == 0)
return ret;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups
2012-02-03 20:09 ` [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups Russell King - ARM Linux
@ 2012-02-03 20:32 ` Greg KH
2012-02-03 20:38 ` Russell King - ARM Linux
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2012-02-03 20:32 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Feb 03, 2012 at 08:09:12PM +0000, Russell King - ARM Linux wrote:
> Clean up the ohci-sa1111 driver formatting to be more compliant with
> current standards, and add 'static' to various function definitions
> to avoid sparse complaints about undeclared functions. Remove the
> unnecessary local declaration of 'usb_disabled', which can be found
> instead in linux/usb.h.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Do you want me to take these 5 patches through the USB tree? Or are you
going to take them through an ARM tree?
Either is fine with me, if ARM, feel free to add:
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
to them.
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups
2012-02-03 20:32 ` Greg KH
@ 2012-02-03 20:38 ` Russell King - ARM Linux
2012-02-03 20:47 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Russell King - ARM Linux @ 2012-02-03 20:38 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Feb 03, 2012 at 12:32:28PM -0800, Greg KH wrote:
> On Fri, Feb 03, 2012 at 08:09:12PM +0000, Russell King - ARM Linux wrote:
> > Clean up the ohci-sa1111 driver formatting to be more compliant with
> > current standards, and add 'static' to various function definitions
> > to avoid sparse complaints about undeclared functions. Remove the
> > unnecessary local declaration of 'usb_disabled', which can be found
> > instead in linux/usb.h.
> >
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
>
> Do you want me to take these 5 patches through the USB tree? Or are you
> going to take them through an ARM tree?
I forgot to send the introduction to linux-usb, so you've probably missed
the comment that they depend on some previous patches.
> Either is fine with me, if ARM, feel free to add:
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> to them.
There was one question mark I had over a patch - that was the addition
of the .reset method in the hc_driver for sa1111 stuff. This seems to
only get called once during initial driver bring-up. Comments I found
in the code suggest that it was used more often in the past. Is that
something that's going away?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups
2012-02-03 20:38 ` Russell King - ARM Linux
@ 2012-02-03 20:47 ` Greg KH
2012-02-03 20:59 ` Alan Stern
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2012-02-03 20:47 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Feb 03, 2012 at 08:38:10PM +0000, Russell King - ARM Linux wrote:
> On Fri, Feb 03, 2012 at 12:32:28PM -0800, Greg KH wrote:
> > On Fri, Feb 03, 2012 at 08:09:12PM +0000, Russell King - ARM Linux wrote:
> > > Clean up the ohci-sa1111 driver formatting to be more compliant with
> > > current standards, and add 'static' to various function definitions
> > > to avoid sparse complaints about undeclared functions. Remove the
> > > unnecessary local declaration of 'usb_disabled', which can be found
> > > instead in linux/usb.h.
> > >
> > > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> >
> > Do you want me to take these 5 patches through the USB tree? Or are you
> > going to take them through an ARM tree?
>
> I forgot to send the introduction to linux-usb, so you've probably missed
> the comment that they depend on some previous patches.
Yeah, I missed that :)
If these depend on other patches, feel free to take them in your tree
then.
> > Either is fine with me, if ARM, feel free to add:
> > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
> > to them.
>
> There was one question mark I had over a patch - that was the addition
> of the .reset method in the hc_driver for sa1111 stuff. This seems to
> only get called once during initial driver bring-up. Comments I found
> in the code suggest that it was used more often in the past. Is that
> something that's going away?
I don't think so, but Alan (on linux-usb@) would be the best to answer
that one.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups
2012-02-03 20:47 ` Greg KH
@ 2012-02-03 20:59 ` Alan Stern
0 siblings, 0 replies; 10+ messages in thread
From: Alan Stern @ 2012-02-03 20:59 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 3 Feb 2012, Greg KH wrote:
> > There was one question mark I had over a patch - that was the addition
> > of the .reset method in the hc_driver for sa1111 stuff. This seems to
> > only get called once during initial driver bring-up. Comments I found
> > in the code suggest that it was used more often in the past. Is that
> > something that's going away?
>
> I don't think so, but Alan (on linux-usb@) would be the best to answer
> that one.
The "reset" method is not named very well; it really should be called
"initialize". At any rate, you're right -- it gets called exactly once
during the lifetime of the HC, and no, that's not going to change.
Alan Stern
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-02-03 20:59 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-03 20:04 [PATCH 0/5] SA1111 USB cleanups Russell King - ARM Linux
2012-02-03 20:09 ` [PATCH 1/5] USB: sa1111: sparse and checkpatch cleanups Russell King - ARM Linux
2012-02-03 20:32 ` Greg KH
2012-02-03 20:38 ` Russell King - ARM Linux
2012-02-03 20:47 ` Greg KH
2012-02-03 20:59 ` Alan Stern
2012-02-03 20:09 ` [PATCH 2/5] USB: sa1111: get rid of nasty printk(KERN_DEBUG "%s: ...", __FILE__) Russell King - ARM Linux
2012-02-03 20:09 ` [PATCH 3/5] USB: sa1111: reorganize ohci-sa1111.c Russell King - ARM Linux
2012-02-03 20:10 ` [PATCH 4/5] USB: sa1111: add OHCI shutdown methods Russell King - ARM Linux
2012-02-03 20:10 ` [PATCH 5/5] USB: sa1111: add hcd .reset method Russell King - ARM Linux
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).