Commit 188d5650 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB PCI drivers: hcd release changes

This patch removes the code for deallocating the usb_hcd structure from
the three PCI-based host controller drivers.  It also moves the embedded
struct usb_hcd member to the front of the larger driver-specific
structures, as required for the core to do its work.  Please apply.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 1e727616
...@@ -1096,7 +1096,6 @@ static const struct hc_driver ehci_driver = { ...@@ -1096,7 +1096,6 @@ static const struct hc_driver ehci_driver = {
* memory lifecycle (except per-request) * memory lifecycle (except per-request)
*/ */
.hcd_alloc = ehci_hcd_alloc, .hcd_alloc = ehci_hcd_alloc,
.hcd_free = ehci_hcd_free,
/* /*
* managing i/o requests and associated device resources * managing i/o requests and associated device resources
......
...@@ -50,11 +50,6 @@ static struct usb_hcd *ehci_hcd_alloc (void) ...@@ -50,11 +50,6 @@ static struct usb_hcd *ehci_hcd_alloc (void)
return NULL; return NULL;
} }
static void ehci_hcd_free (struct usb_hcd *hcd)
{
kfree (hcd_to_ehci (hcd));
}
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* Allocate the key transfer structures from the previously allocated pool */ /* Allocate the key transfer structures from the previously allocated pool */
......
...@@ -47,6 +47,13 @@ struct ehci_stats { ...@@ -47,6 +47,13 @@ struct ehci_stats {
#define EHCI_MAX_ROOT_PORTS 15 /* see HCS_N_PORTS */ #define EHCI_MAX_ROOT_PORTS 15 /* see HCS_N_PORTS */
struct ehci_hcd { /* one per controller */ struct ehci_hcd { /* one per controller */
/* glue to PCI and HCD framework */
struct usb_hcd hcd; /* must come first! */
struct ehci_caps __iomem *caps;
struct ehci_regs __iomem *regs;
__u32 hcs_params; /* cached register copy */
spinlock_t lock; spinlock_t lock;
/* async schedule support */ /* async schedule support */
...@@ -69,12 +76,6 @@ struct ehci_hcd { /* one per controller */ ...@@ -69,12 +76,6 @@ struct ehci_hcd { /* one per controller */
/* per root hub port */ /* per root hub port */
unsigned long reset_done [EHCI_MAX_ROOT_PORTS]; unsigned long reset_done [EHCI_MAX_ROOT_PORTS];
/* glue to PCI and HCD framework */
struct usb_hcd hcd;
struct ehci_caps __iomem *caps;
struct ehci_regs __iomem *regs;
__u32 hcs_params; /* cached register copy */
/* per-HC memory pools (could be per-bus, but ...) */ /* per-HC memory pools (could be per-bus, but ...) */
struct dma_pool *qh_pool; /* qh per active urb */ struct dma_pool *qh_pool; /* qh per active urb */
struct dma_pool *qtd_pool; /* one or more per qh */ struct dma_pool *qtd_pool; /* one or more per qh */
......
...@@ -40,11 +40,6 @@ static struct usb_hcd *ohci_hcd_alloc (void) ...@@ -40,11 +40,6 @@ static struct usb_hcd *ohci_hcd_alloc (void)
return NULL; return NULL;
} }
static void ohci_hcd_free (struct usb_hcd *hcd)
{
kfree (hcd_to_ohci (hcd));
}
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int ohci_mem_init (struct ohci_hcd *ohci) static int ohci_mem_init (struct ohci_hcd *ohci)
......
...@@ -204,7 +204,6 @@ static const struct hc_driver ohci_pci_hc_driver = { ...@@ -204,7 +204,6 @@ static const struct hc_driver ohci_pci_hc_driver = {
* memory lifecycle (except per-request) * memory lifecycle (except per-request)
*/ */
.hcd_alloc = ohci_hcd_alloc, .hcd_alloc = ohci_hcd_alloc,
.hcd_free = ohci_hcd_free,
/* /*
* managing i/o requests and associated device resources * managing i/o requests and associated device resources
......
...@@ -337,6 +337,11 @@ typedef struct urb_priv { ...@@ -337,6 +337,11 @@ typedef struct urb_priv {
*/ */
struct ohci_hcd { struct ohci_hcd {
/*
* framework state
*/
struct usb_hcd hcd; /* must come first! */
spinlock_t lock; spinlock_t lock;
/* /*
...@@ -389,10 +394,6 @@ struct ohci_hcd { ...@@ -389,10 +394,6 @@ struct ohci_hcd {
#define OHCI_QUIRK_INITRESET 0x04 /* SiS, OPTi, ... */ #define OHCI_QUIRK_INITRESET 0x04 /* SiS, OPTi, ... */
// there are also chip quirks/bugs in init logic // there are also chip quirks/bugs in init logic
/*
* framework state
*/
struct usb_hcd hcd;
}; };
#define hcd_to_ohci(hcd_ptr) container_of(hcd_ptr, struct ohci_hcd, hcd) #define hcd_to_ohci(hcd_ptr) container_of(hcd_ptr, struct ohci_hcd, hcd)
......
...@@ -2290,11 +2290,6 @@ static struct usb_hcd *uhci_hcd_alloc(void) ...@@ -2290,11 +2290,6 @@ static struct usb_hcd *uhci_hcd_alloc(void)
return &uhci->hcd; return &uhci->hcd;
} }
static void uhci_hcd_free(struct usb_hcd *hcd)
{
kfree(hcd_to_uhci(hcd));
}
/* Are there any URBs for a particular device/endpoint on a given list? */ /* Are there any URBs for a particular device/endpoint on a given list? */
static int urbs_for_ep_list(struct list_head *head, static int urbs_for_ep_list(struct list_head *head,
struct hcd_dev *hdev, int ep) struct hcd_dev *hdev, int ep)
...@@ -2359,7 +2354,6 @@ static const struct hc_driver uhci_driver = { ...@@ -2359,7 +2354,6 @@ static const struct hc_driver uhci_driver = {
.stop = uhci_stop, .stop = uhci_stop,
.hcd_alloc = uhci_hcd_alloc, .hcd_alloc = uhci_hcd_alloc,
.hcd_free = uhci_hcd_free,
.urb_enqueue = uhci_urb_enqueue, .urb_enqueue = uhci_urb_enqueue,
.urb_dequeue = uhci_urb_dequeue, .urb_dequeue = uhci_urb_dequeue,
......
...@@ -324,7 +324,7 @@ enum uhci_state { ...@@ -324,7 +324,7 @@ enum uhci_state {
* a subset of what the full implementation needs. * a subset of what the full implementation needs.
*/ */
struct uhci_hcd { struct uhci_hcd {
struct usb_hcd hcd; struct usb_hcd hcd; /* must come first! */
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
/* procfs */ /* procfs */
......
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