Skip to content

Commit 96b96b2

Browse files
pawellcdnsgregkh
authored andcommitted
usb: cdnsp: changes PCI Device ID to fix conflict with CNDS3 driver
Patch changes CDNS_DEVICE_ID in USBSSP PCI Glue driver to remove the conflict with Cadence USBSS driver. cc: <[email protected]> Fixes: 3d82904 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Signed-off-by: Pawel Laszczak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1272fd6 commit 96b96b2

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

drivers/usb/cdns3/cdnsp-pci.c

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,23 @@
2929
#define PLAT_DRIVER_NAME "cdns-usbssp"
3030

3131
#define CDNS_VENDOR_ID 0x17cd
32-
#define CDNS_DEVICE_ID 0x0100
32+
#define CDNS_DEVICE_ID 0x0200
33+
#define CDNS_DRD_ID 0x0100
3334
#define CDNS_DRD_IF (PCI_CLASS_SERIAL_USB << 8 | 0x80)
3435

3536
static struct pci_dev *cdnsp_get_second_fun(struct pci_dev *pdev)
3637
{
37-
struct pci_dev *func;
38-
3938
/*
4039
* Gets the second function.
41-
* It's little tricky, but this platform has two function.
42-
* The fist keeps resources for Host/Device while the second
43-
* keeps resources for DRD/OTG.
40+
* Platform has two function. The fist keeps resources for
41+
* Host/Device while the secon keeps resources for DRD/OTG.
4442
*/
45-
func = pci_get_device(pdev->vendor, pdev->device, NULL);
46-
if (!func)
47-
return NULL;
43+
if (pdev->device == CDNS_DEVICE_ID)
44+
return pci_get_device(pdev->vendor, CDNS_DRD_ID, NULL);
45+
else if (pdev->device == CDNS_DRD_ID)
46+
return pci_get_device(pdev->vendor, CDNS_DEVICE_ID, NULL);
4847

49-
if (func->devfn == pdev->devfn) {
50-
func = pci_get_device(pdev->vendor, pdev->device, func);
51-
if (!func)
52-
return NULL;
53-
}
54-
55-
return func;
48+
return NULL;
5649
}
5750

5851
static int cdnsp_pci_probe(struct pci_dev *pdev,
@@ -230,6 +223,8 @@ static const struct pci_device_id cdnsp_pci_ids[] = {
230223
PCI_CLASS_SERIAL_USB_DEVICE, PCI_ANY_ID },
231224
{ PCI_VENDOR_ID_CDNS, CDNS_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,
232225
CDNS_DRD_IF, PCI_ANY_ID },
226+
{ PCI_VENDOR_ID_CDNS, CDNS_DRD_ID, PCI_ANY_ID, PCI_ANY_ID,
227+
CDNS_DRD_IF, PCI_ANY_ID },
233228
{ 0, }
234229
};
235230

0 commit comments

Comments
 (0)