USB: EHCI: miscellaneous cleanups for the library conversion
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 7 Nov 2012 21:12:47 +0000 (16:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Nov 2012 02:06:48 +0000 (18:06 -0800)
This patch (as1630) cleans up a few minor items resulting from the
split-up of the ehci-hcd driver:

Remove the product_desc string from the ehci_driver_overrides
structure.  All drivers will use the generic "EHCI Host
Controller" string.  (This was requested by Felipe Balbi.)

Allow drivers to pass a NULL pointer to ehci_init_driver()
if they don't have to override any settings.

Remove a #define symbol that is no longer used from the
ChipIdea host driver.

Rename overrides to pci_overrides in ehci-pci.c, for
consistency with ehci-platform.c.

Mark the *_overrides structures as __initdata.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/host.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci-platform.c
drivers/usb/host/ehci.h

index fed97d3..caecad9 100644 (file)
 #include <linux/usb/hcd.h>
 #include <linux/usb/chipidea.h>
 
-#define CHIPIDEA_EHCI
 #include "../host/ehci.h"
 
 #include "ci.h"
 #include "bits.h"
 #include "host.h"
 
-static const struct ehci_driver_overrides ci_overrides = {
-       .product_desc =         "ChipIdea HDRC EHCI host controller",
-};
-
 static struct hc_driver __read_mostly ci_ehci_hc_driver;
 
 static irqreturn_t host_irq(struct ci13xxx *ci)
@@ -103,7 +98,7 @@ int ci_hdrc_host_init(struct ci13xxx *ci)
        rdrv->name      = "host";
        ci->roles[CI_ROLE_HOST] = rdrv;
 
-       ehci_init_driver(&ci_ehci_hc_driver, &ci_overrides);
+       ehci_init_driver(&ci_ehci_hc_driver, NULL);
 
        return 0;
 }
index 28f694e..c97503b 100644 (file)
@@ -1231,10 +1231,11 @@ void ehci_init_driver(struct hc_driver *drv,
        /* Copy the generic table to drv and then apply the overrides */
        *drv = ehci_hc_driver;
 
-       drv->product_desc = over->product_desc;
-       drv->hcd_priv_size += over->extra_priv_size;
-       if (over->reset)
-               drv->reset = over->reset;
+       if (over) {
+               drv->hcd_priv_size += over->extra_priv_size;
+               if (over->reset)
+                       drv->reset = over->reset;
+       }
 }
 EXPORT_SYMBOL_GPL(ehci_init_driver);
 
index 46018e9..3fb76ca 100644 (file)
@@ -383,8 +383,7 @@ static int ehci_pci_resume(struct usb_hcd *hcd, bool hibernated)
 
 static struct hc_driver __read_mostly ehci_pci_hc_driver;
 
-static const struct ehci_driver_overrides overrides = {
-       .product_desc =         "EHCI PCI host controller",
+static const struct ehci_driver_overrides pci_overrides __initdata = {
        .reset =                ehci_pci_setup,
 };
 
@@ -426,7 +425,7 @@ static int __init ehci_pci_init(void)
 
        pr_info("%s: " DRIVER_DESC "\n", hcd_name);
 
-       ehci_init_driver(&ehci_pci_hc_driver, &overrides);
+       ehci_init_driver(&ehci_pci_hc_driver, &pci_overrides);
 
        /* Entries for the PCI suspend/resume callbacks are special */
        ehci_pci_hc_driver.pci_suspend = ehci_suspend;
index feeedf8..f14c542 100644 (file)
@@ -57,8 +57,7 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
 
 static struct hc_driver __read_mostly ehci_platform_hc_driver;
 
-static const struct ehci_driver_overrides platform_overrides = {
-       .product_desc = "Generic Platform EHCI controller",
+static const struct ehci_driver_overrides platform_overrides __initdata = {
        .reset =        ehci_platform_reset,
 };
 
index 24a8ada..9dadc71 100644 (file)
@@ -784,7 +784,6 @@ static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x)
 /* Declarations of things exported for use by ehci platform drivers */
 
 struct ehci_driver_overrides {
-       const char      *product_desc;
        size_t          extra_priv_size;
        int             (*reset)(struct usb_hcd *hcd);
 };