diff -Nru a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c --- a/drivers/usb/host/ohci-pci.c Wed Feb 11 11:42:39 2004 +++ b/drivers/usb/host/ohci-pci.c Wed Feb 11 11:42:39 2004 @@ -45,17 +45,19 @@ struct ohci_hcd *ohci = hcd_to_ohci (hcd); int ret; - if (hcd->pdev) { - ohci->hcca = pci_alloc_consistent (hcd->pdev, - sizeof *ohci->hcca, &ohci->hcca_dma); - if (!ohci->hcca) - return -ENOMEM; + ohci->hcca = dma_alloc_coherent (hcd->self.controller, + sizeof *ohci->hcca, &ohci->hcca_dma, 0); + if (!ohci->hcca) + return -ENOMEM; + + if(hcd->self.controller && hcd->self.controller->bus == &pci_bus_type) { + struct pci_dev *pdev = to_pci_dev(hcd->self.controller); /* AMD 756, for most chips (early revs), corrupts register * values on read ... so enable the vendor workaround. */ - if (hcd->pdev->vendor == PCI_VENDOR_ID_AMD - && hcd->pdev->device == 0x740c) { + if (pdev->vendor == PCI_VENDOR_ID_AMD + && pdev->device == 0x740c) { ohci->flags = OHCI_QUIRK_AMD756; ohci_info (ohci, "AMD756 erratum 4 workaround\n"); } @@ -68,8 +70,8 @@ * for this chip. Evidently control and bulk lists * can get confused. (B&W G3 models, and ...) */ - else if (hcd->pdev->vendor == PCI_VENDOR_ID_OPTI - && hcd->pdev->device == 0xc861) { + else if (pdev->vendor == PCI_VENDOR_ID_OPTI + && pdev->device == 0xc861) { ohci_info (ohci, "WARNING: OPTi workarounds unavailable\n"); } @@ -78,12 +80,11 @@ * identify the USB (fn2). This quirk might apply to more or * even all NSC stuff. */ - else if (hcd->pdev->vendor == PCI_VENDOR_ID_NS) { - struct pci_dev *b, *hc; + else if (pdev->vendor == PCI_VENDOR_ID_NS) { + struct pci_dev *b; - hc = hcd->pdev; - b = pci_find_slot (hc->bus->number, - PCI_DEVFN (PCI_SLOT (hc->devfn), 1)); + b = pci_find_slot (pdev->bus->number, + PCI_DEVFN (PCI_SLOT (pdev->devfn), 1)); if (b && b->device == PCI_DEVICE_ID_NS_87560_LIO && b->vendor == PCI_VENDOR_ID_NS) { ohci->flags |= OHCI_QUIRK_SUPERIO; @@ -145,7 +146,7 @@ #ifdef CONFIG_PMAC_PBOOK if (_machine == _MACH_Pmac) - disable_irq (hcd->pdev->irq); + disable_irq ((to_pci_dev(hcd->self.controller))->irq); /* else, 2.4 assumes shared irqs -- don't disable */ #endif @@ -179,15 +180,17 @@ * memory during sleep. We disable its bus master bit during * suspend */ - pci_read_config_word (hcd->pdev, PCI_COMMAND, &cmd); + pci_read_config_word (to_pci_dev(hcd->self.controller), PCI_COMMAND, + &cmd); cmd &= ~PCI_COMMAND_MASTER; - pci_write_config_word (hcd->pdev, PCI_COMMAND, cmd); + pci_write_config_word (to_pci_dev(hcd->self.controller), PCI_COMMAND, + cmd); #ifdef CONFIG_PMAC_PBOOK { struct device_node *of_node; /* Disable USB PAD & cell clock */ - of_node = pci_device_to_OF_node (hcd->pdev); + of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller)); if (of_node) pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 0); } @@ -207,7 +210,7 @@ struct device_node *of_node; /* Re-enable USB PAD & cell clock */ - of_node = pci_device_to_OF_node (hcd->pdev); + of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller)); if (of_node) pmac_call_feature (PMAC_FTR_USB_ENABLE, of_node, 0, 1); } @@ -222,7 +225,7 @@ #endif /* Re-enable bus mastering */ - pci_set_master (ohci->hcd.pdev); + pci_set_master (to_pci_dev(ohci->hcd.self.controller)); switch (temp) { @@ -282,7 +285,7 @@ #ifdef CONFIG_PMAC_PBOOK if (_machine == _MACH_Pmac) - enable_irq (hcd->pdev->irq); + enable_irq (to_pci_dev(hcd->self.controller)->irq); #endif /* Check for a pending done list */
------------------------------------------------------- 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