diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
--- a/drivers/usb/host/uhci-hcd.c       Wed Feb 11 11:42:39 2004
+++ b/drivers/usb/host/uhci-hcd.c       Wed Feb 11 11:42:39 2004
@@ -41,6 +41,8 @@
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
 #include <linux/proc_fs.h>
+#include <linux/dmapool.h>
+#include <linux/dma-mapping.h>
 #ifdef CONFIG_USB_DEBUG
 #define DEBUG
 #else
@@ -143,7 +145,7 @@
        dma_addr_t dma_handle;
        struct uhci_td *td;
 
-       td = pci_pool_alloc(uhci->td_pool, GFP_ATOMIC, &dma_handle);
+       td = dma_pool_alloc(uhci->td_pool, GFP_ATOMIC, &dma_handle);
        if (!td)
                return NULL;
 
@@ -295,7 +297,7 @@
        if (td->dev)
                usb_put_dev(td->dev);
 
-       pci_pool_free(uhci->td_pool, td, td->dma_handle);
+       dma_pool_free(uhci->td_pool, td, td->dma_handle);
 }
 
 static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci, struct usb_device *dev)
@@ -303,7 +305,7 @@
        dma_addr_t dma_handle;
        struct uhci_qh *qh;
 
-       qh = pci_pool_alloc(uhci->qh_pool, GFP_ATOMIC, &dma_handle);
+       qh = dma_pool_alloc(uhci->qh_pool, GFP_ATOMIC, &dma_handle);
        if (!qh)
                return NULL;
 
@@ -333,7 +335,7 @@
        if (qh->dev)
                usb_put_dev(qh->dev);
 
-       pci_pool_free(uhci->qh_pool, qh, qh->dma_handle);
+       dma_pool_free(uhci->qh_pool, qh, qh->dma_handle);
 }
 
 /*
@@ -2049,7 +2051,8 @@
        unsigned int io_addr = uhci->io_addr;
        int i;
 
-       if (!uhci->hcd.pdev || uhci->hcd.pdev->vendor != PCI_VENDOR_ID_INTEL)
+       if (!uhci->hcd.self.controller || 
+               to_pci_dev(uhci->hcd.self.controller)->vendor != PCI_VENDOR_ID_INTEL)
                return 1;
 
        /* Some of Intel's USB controllers have a bug that causes false
@@ -2163,17 +2166,17 @@
        }
 
        if (uhci->qh_pool) {
-               pci_pool_destroy(uhci->qh_pool);
+               dma_pool_destroy(uhci->qh_pool);
                uhci->qh_pool = NULL;
        }
 
        if (uhci->td_pool) {
-               pci_pool_destroy(uhci->td_pool);
+               dma_pool_destroy(uhci->td_pool);
                uhci->td_pool = NULL;
        }
 
        if (uhci->fl) {
-               pci_free_consistent(uhci->hcd.pdev, sizeof(*uhci->fl), uhci->fl, 
uhci->fl->dma_handle);
+               dma_free_coherent(uhci->hcd.self.controller, sizeof(*uhci->fl), 
uhci->fl, uhci->fl->dma_handle);
                uhci->fl = NULL;
        }
 
@@ -2198,7 +2201,7 @@
         * interrupts from any previous setup.
         */
        reset_hc(uhci);
-       pci_write_config_word(hcd->pdev, USBLEGSUP, USBLEGSUP_DEFAULT);
+       pci_write_config_word(to_pci_dev(hcd->self.controller), USBLEGSUP, 
USBLEGSUP_DEFAULT);
        return 0;
 }
 
@@ -2230,7 +2233,7 @@
        struct proc_dir_entry *ent;
 #endif
 
-       io_size = pci_resource_len(hcd->pdev, hcd->region);
+       io_size = pci_resource_len(to_pci_dev(hcd->self.controller), hcd->region);
 
 #ifdef CONFIG_PROC_FS
        ent = create_proc_entry(hcd->self.bus_name, S_IFREG|S_IRUGO|S_IWUSR, 
uhci_proc_root);
@@ -2266,7 +2269,8 @@
 
        spin_lock_init(&uhci->frame_list_lock);
 
-       uhci->fl = pci_alloc_consistent(hcd->pdev, sizeof(*uhci->fl), &dma_handle);
+       uhci->fl = dma_alloc_coherent(hcd->self.controller, 
+                       sizeof(*uhci->fl), &dma_handle, 0);
        if (!uhci->fl) {
                err("unable to allocate consistent memory for frame list");
                goto err_alloc_fl;
@@ -2276,17 +2280,17 @@
 
        uhci->fl->dma_handle = dma_handle;
 
-       uhci->td_pool = pci_pool_create("uhci_td", hcd->pdev,
+       uhci->td_pool = dma_pool_create("uhci_td", hcd->self.controller,
                sizeof(struct uhci_td), 16, 0);
        if (!uhci->td_pool) {
-               err("unable to create td pci_pool");
+               err("unable to create td dma_pool");
                goto err_create_td_pool;
        }
 
-       uhci->qh_pool = pci_pool_create("uhci_qh", hcd->pdev,
+       uhci->qh_pool = dma_pool_create("uhci_qh", hcd->self.controller,
                sizeof(struct uhci_qh), 16, 0);
        if (!uhci->qh_pool) {
-               err("unable to create qh pci_pool");
+               err("unable to create qh dma_pool");
                goto err_create_qh_pool;
        }
 
@@ -2402,7 +2406,7 @@
 
        udev->speed = USB_SPEED_FULL;
 
-       if (usb_register_root_hub(udev, &hcd->pdev->dev) != 0) {
+       if (usb_register_root_hub(udev, hcd->self.controller) != 0) {
                err("unable to start root hub");
                retval = -ENOMEM;
                goto err_start_root_hub;
@@ -2433,15 +2437,16 @@
        hcd->self.root_hub = NULL;
 
 err_alloc_root_hub:
-       pci_pool_destroy(uhci->qh_pool);
+       dma_pool_destroy(uhci->qh_pool);
        uhci->qh_pool = NULL;
 
 err_create_qh_pool:
-       pci_pool_destroy(uhci->td_pool);
+       dma_pool_destroy(uhci->td_pool);
        uhci->td_pool = NULL;
 
 err_create_td_pool:
-       pci_free_consistent(hcd->pdev, sizeof(*uhci->fl), uhci->fl, 
uhci->fl->dma_handle);
+       dma_free_coherent(hcd->self.controller, 
+                       sizeof(*uhci->fl), uhci->fl, uhci->fl->dma_handle);
        uhci->fl = NULL;
 
 err_alloc_fl:
@@ -2494,7 +2499,7 @@
 {
        struct uhci_hcd *uhci = hcd_to_uhci(hcd);
 
-       pci_set_master(uhci->hcd.pdev);
+       pci_set_master(to_pci_dev(uhci->hcd.self.controller));
 
        if (uhci->state == UHCI_SUSPENDED)
                uhci->resume_detect = 1;


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to