mirror of
https://github.com/torvalds/linux.git
synced 2024-10-22 21:20:52 +00:00
sub: cdns3: Use predefined PCI vendor ID constant
The PCI vendor ID for Cadence is defined in pci_ids.h. Use it. While at it, move to PCI_DEVICE() macro and usual pattern for PCI class and device IDs. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240913131710.3630560-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d2a18bbc52
commit
68d4209158
|
@ -37,8 +37,7 @@ struct cdns3_wrap {
|
||||||
#define PCI_DRIVER_NAME "cdns3-pci-usbss"
|
#define PCI_DRIVER_NAME "cdns3-pci-usbss"
|
||||||
#define PLAT_DRIVER_NAME "cdns-usb3"
|
#define PLAT_DRIVER_NAME "cdns-usb3"
|
||||||
|
|
||||||
#define CDNS_VENDOR_ID 0x17cd
|
#define PCI_DEVICE_ID_CDNS_USB3 0x0100
|
||||||
#define CDNS_DEVICE_ID 0x0100
|
|
||||||
|
|
||||||
static struct pci_dev *cdns3_get_second_fun(struct pci_dev *pdev)
|
static struct pci_dev *cdns3_get_second_fun(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
|
@ -190,7 +189,7 @@ static void cdns3_pci_remove(struct pci_dev *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pci_device_id cdns3_pci_ids[] = {
|
static const struct pci_device_id cdns3_pci_ids[] = {
|
||||||
{ PCI_DEVICE(CDNS_VENDOR_ID, CDNS_DEVICE_ID), },
|
{ PCI_VDEVICE(CDNS, PCI_DEVICE_ID_CDNS_USB3) },
|
||||||
{ 0, }
|
{ 0, }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,11 @@
|
||||||
#define PCI_DRIVER_NAME "cdns-pci-usbssp"
|
#define PCI_DRIVER_NAME "cdns-pci-usbssp"
|
||||||
#define PLAT_DRIVER_NAME "cdns-usbssp"
|
#define PLAT_DRIVER_NAME "cdns-usbssp"
|
||||||
|
|
||||||
#define CDNS_VENDOR_ID 0x17cd
|
#define PCI_DEVICE_ID_CDNS_USB3 0x0100
|
||||||
#define CDNS_DEVICE_ID 0x0200
|
#define PCI_DEVICE_ID_CDNS_UDC 0x0200
|
||||||
#define CDNS_DRD_ID 0x0100
|
|
||||||
#define CDNS_DRD_IF (PCI_CLASS_SERIAL_USB << 8 | 0x80)
|
#define PCI_CLASS_SERIAL_USB_CDNS_USB3 (PCI_CLASS_SERIAL_USB << 8 | 0x80)
|
||||||
|
#define PCI_CLASS_SERIAL_USB_CDNS_UDC PCI_CLASS_SERIAL_USB_DEVICE
|
||||||
|
|
||||||
static struct pci_dev *cdnsp_get_second_fun(struct pci_dev *pdev)
|
static struct pci_dev *cdnsp_get_second_fun(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
|
@ -40,10 +41,10 @@ static struct pci_dev *cdnsp_get_second_fun(struct pci_dev *pdev)
|
||||||
* Platform has two function. The fist keeps resources for
|
* Platform has two function. The fist keeps resources for
|
||||||
* Host/Device while the secon keeps resources for DRD/OTG.
|
* Host/Device while the secon keeps resources for DRD/OTG.
|
||||||
*/
|
*/
|
||||||
if (pdev->device == CDNS_DEVICE_ID)
|
if (pdev->device == PCI_DEVICE_ID_CDNS_UDC)
|
||||||
return pci_get_device(pdev->vendor, CDNS_DRD_ID, NULL);
|
return pci_get_device(pdev->vendor, PCI_DEVICE_ID_CDNS_USB3, NULL);
|
||||||
else if (pdev->device == CDNS_DRD_ID)
|
if (pdev->device == PCI_DEVICE_ID_CDNS_USB3)
|
||||||
return pci_get_device(pdev->vendor, CDNS_DEVICE_ID, NULL);
|
return pci_get_device(pdev->vendor, PCI_DEVICE_ID_CDNS_UDC, NULL);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -220,12 +221,12 @@ static const struct dev_pm_ops cdnsp_pci_pm_ops = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct pci_device_id cdnsp_pci_ids[] = {
|
static const struct pci_device_id cdnsp_pci_ids[] = {
|
||||||
{ PCI_VENDOR_ID_CDNS, CDNS_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,
|
{ PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_UDC),
|
||||||
PCI_CLASS_SERIAL_USB_DEVICE, PCI_ANY_ID },
|
.class = PCI_CLASS_SERIAL_USB_CDNS_UDC },
|
||||||
{ PCI_VENDOR_ID_CDNS, CDNS_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,
|
{ PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_UDC),
|
||||||
CDNS_DRD_IF, PCI_ANY_ID },
|
.class = PCI_CLASS_SERIAL_USB_CDNS_USB3 },
|
||||||
{ PCI_VENDOR_ID_CDNS, CDNS_DRD_ID, PCI_ANY_ID, PCI_ANY_ID,
|
{ PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_USB3),
|
||||||
CDNS_DRD_IF, PCI_ANY_ID },
|
.class = PCI_CLASS_SERIAL_USB_CDNS_USB3 },
|
||||||
{ 0, }
|
{ 0, }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user