aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-11-07 16:12:47 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-11 21:06:48 -0500
commit1b36810e27a9791878e4694357ab6d4c06acc22d (patch)
tree7d671926432dac18b705c5bbde6cbfb275fb97a6 /drivers/usb
parent36caff5d795429c572443894e8789c2150dd796b (diff)
USB: EHCI: miscellaneous cleanups for the library conversion
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/chipidea/host.c7
-rw-r--r--drivers/usb/host/ehci-hcd.c9
-rw-r--r--drivers/usb/host/ehci-pci.c5
-rw-r--r--drivers/usb/host/ehci-platform.c3
-rw-r--r--drivers/usb/host/ehci.h1
5 files changed, 9 insertions, 16 deletions
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index fed97d323899..caecad9213f5 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -25,17 +25,12 @@
25#include <linux/usb/hcd.h> 25#include <linux/usb/hcd.h>
26#include <linux/usb/chipidea.h> 26#include <linux/usb/chipidea.h>
27 27
28#define CHIPIDEA_EHCI
29#include "../host/ehci.h" 28#include "../host/ehci.h"
30 29
31#include "ci.h" 30#include "ci.h"
32#include "bits.h" 31#include "bits.h"
33#include "host.h" 32#include "host.h"
34 33
35static const struct ehci_driver_overrides ci_overrides = {
36 .product_desc = "ChipIdea HDRC EHCI host controller",
37};
38
39static struct hc_driver __read_mostly ci_ehci_hc_driver; 34static struct hc_driver __read_mostly ci_ehci_hc_driver;
40 35
41static irqreturn_t host_irq(struct ci13xxx *ci) 36static irqreturn_t host_irq(struct ci13xxx *ci)
@@ -103,7 +98,7 @@ int ci_hdrc_host_init(struct ci13xxx *ci)
103 rdrv->name = "host"; 98 rdrv->name = "host";
104 ci->roles[CI_ROLE_HOST] = rdrv; 99 ci->roles[CI_ROLE_HOST] = rdrv;
105 100
106 ehci_init_driver(&ci_ehci_hc_driver, &ci_overrides); 101 ehci_init_driver(&ci_ehci_hc_driver, NULL);
107 102
108 return 0; 103 return 0;
109} 104}
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 28f694eb624b..c97503bb0b0e 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1231,10 +1231,11 @@ void ehci_init_driver(struct hc_driver *drv,
1231 /* Copy the generic table to drv and then apply the overrides */ 1231 /* Copy the generic table to drv and then apply the overrides */
1232 *drv = ehci_hc_driver; 1232 *drv = ehci_hc_driver;
1233 1233
1234 drv->product_desc = over->product_desc; 1234 if (over) {
1235 drv->hcd_priv_size += over->extra_priv_size; 1235 drv->hcd_priv_size += over->extra_priv_size;
1236 if (over->reset) 1236 if (over->reset)
1237 drv->reset = over->reset; 1237 drv->reset = over->reset;
1238 }
1238} 1239}
1239EXPORT_SYMBOL_GPL(ehci_init_driver); 1240EXPORT_SYMBOL_GPL(ehci_init_driver);
1240 1241
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 46018e975244..3fb76ca61848 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -383,8 +383,7 @@ static int ehci_pci_resume(struct usb_hcd *hcd, bool hibernated)
383 383
384static struct hc_driver __read_mostly ehci_pci_hc_driver; 384static struct hc_driver __read_mostly ehci_pci_hc_driver;
385 385
386static const struct ehci_driver_overrides overrides = { 386static const struct ehci_driver_overrides pci_overrides __initdata = {
387 .product_desc = "EHCI PCI host controller",
388 .reset = ehci_pci_setup, 387 .reset = ehci_pci_setup,
389}; 388};
390 389
@@ -426,7 +425,7 @@ static int __init ehci_pci_init(void)
426 425
427 pr_info("%s: " DRIVER_DESC "\n", hcd_name); 426 pr_info("%s: " DRIVER_DESC "\n", hcd_name);
428 427
429 ehci_init_driver(&ehci_pci_hc_driver, &overrides); 428 ehci_init_driver(&ehci_pci_hc_driver, &pci_overrides);
430 429
431 /* Entries for the PCI suspend/resume callbacks are special */ 430 /* Entries for the PCI suspend/resume callbacks are special */
432 ehci_pci_hc_driver.pci_suspend = ehci_suspend; 431 ehci_pci_hc_driver.pci_suspend = ehci_suspend;
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index feeedf840117..f14c542b142f 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -57,8 +57,7 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
57 57
58static struct hc_driver __read_mostly ehci_platform_hc_driver; 58static struct hc_driver __read_mostly ehci_platform_hc_driver;
59 59
60static const struct ehci_driver_overrides platform_overrides = { 60static const struct ehci_driver_overrides platform_overrides __initdata = {
61 .product_desc = "Generic Platform EHCI controller",
62 .reset = ehci_platform_reset, 61 .reset = ehci_platform_reset,
63}; 62};
64 63
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 24a8ada4701c..9dadc7118d68 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -784,7 +784,6 @@ static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x)
784/* Declarations of things exported for use by ehci platform drivers */ 784/* Declarations of things exported for use by ehci platform drivers */
785 785
786struct ehci_driver_overrides { 786struct ehci_driver_overrides {
787 const char *product_desc;
788 size_t extra_priv_size; 787 size_t extra_priv_size;
789 int (*reset)(struct usb_hcd *hcd); 788 int (*reset)(struct usb_hcd *hcd);
790}; 789};