Greg:
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.
Alan Stern
Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
===== drivers/usb/host/ehci-hcd.c 1.141 vs edited =====
--- 1.141/drivers/usb/host/ehci-hcd.c 2004-10-22 17:11:55 -04:00
+++ edited/drivers/usb/host/ehci-hcd.c 2004-10-28 11:17:19 -04:00
@@ -1047,7 +1047,6 @@
* memory lifecycle (except per-request)
*/
.hcd_alloc = ehci_hcd_alloc,
- .hcd_free = ehci_hcd_free,
/*
* managing i/o requests and associated device resources
===== drivers/usb/host/ehci-mem.c 1.36 vs edited =====
--- 1.36/drivers/usb/host/ehci-mem.c 2004-10-11 13:51:59 -04:00
+++ edited/drivers/usb/host/ehci-mem.c 2004-10-28 11:17:12 -04:00
@@ -50,11 +50,6 @@
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 */
===== drivers/usb/host/ehci.h 1.63 vs edited =====
--- 1.63/drivers/usb/host/ehci.h 2004-10-18 18:30:24 -04:00
+++ edited/drivers/usb/host/ehci.h 2004-10-28 11:04:06 -04:00
@@ -47,6 +47,13 @@
#define EHCI_MAX_ROOT_PORTS 15 /* see HCS_N_PORTS */
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;
/* async schedule support */
@@ -68,12 +75,6 @@
/* per root hub port */
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 ...) */
struct dma_pool *qh_pool; /* qh per active urb */
===== drivers/usb/host/ohci-mem.c 1.38 vs edited =====
--- 1.38/drivers/usb/host/ohci-mem.c 2004-07-18 07:46:39 -04:00
+++ edited/drivers/usb/host/ohci-mem.c 2004-10-28 11:16:55 -04:00
@@ -40,11 +40,6 @@
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)
===== drivers/usb/host/ohci-pci.c 1.53 vs edited =====
--- 1.53/drivers/usb/host/ohci-pci.c 2004-10-20 12:53:14 -04:00
+++ edited/drivers/usb/host/ohci-pci.c 2004-10-28 11:17:03 -04:00
@@ -204,7 +204,6 @@
* memory lifecycle (except per-request)
*/
.hcd_alloc = ohci_hcd_alloc,
- .hcd_free = ohci_hcd_free,
/*
* managing i/o requests and associated device resources
===== drivers/usb/host/ohci.h 1.53 vs edited =====
--- 1.53/drivers/usb/host/ohci.h 2004-10-20 12:38:10 -04:00
+++ edited/drivers/usb/host/ohci.h 2004-10-28 11:05:13 -04:00
@@ -337,6 +337,11 @@
*/
struct ohci_hcd {
+ /*
+ * framework state
+ */
+ struct usb_hcd hcd; /* must come first! */
+
spinlock_t lock;
/*
@@ -389,10 +394,6 @@
#define OHCI_QUIRK_INITRESET 0x04 /* SiS, OPTi, ... */
// 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)
===== drivers/usb/host/uhci-hcd.c 1.139 vs edited =====
--- 1.139/drivers/usb/host/uhci-hcd.c 2004-10-21 16:02:20 -04:00
+++ edited/drivers/usb/host/uhci-hcd.c 2004-10-28 11:21:24 -04:00
@@ -2286,11 +2286,6 @@
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? */
static int urbs_for_ep_list(struct list_head *head,
struct hcd_dev *hdev, int ep)
@@ -2355,7 +2350,6 @@
.stop = uhci_stop,
.hcd_alloc = uhci_hcd_alloc,
- .hcd_free = uhci_hcd_free,
.urb_enqueue = uhci_urb_enqueue,
.urb_dequeue = uhci_urb_dequeue,
===== drivers/usb/host/uhci-hcd.h 1.39 vs edited =====
--- 1.39/drivers/usb/host/uhci-hcd.h 2004-10-20 12:38:10 -04:00
+++ edited/drivers/usb/host/uhci-hcd.h 2004-10-28 11:05:50 -04:00
@@ -324,7 +324,7 @@
* a subset of what the full implementation needs.
*/
struct uhci_hcd {
- struct usb_hcd hcd;
+ struct usb_hcd hcd; /* must come first! */
#ifdef CONFIG_PROC_FS
/* procfs */
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel