From: Piotr Kwapulinski Date: Wed, 18 Dec 2024 13:12:37 +0000 (+0100) Subject: PCI: Add PCI_VDEVICE_SUB helper macro X-Git-Tag: v6.14-rc1~162^2~154^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=208fff3f567e2a3c3e7e4788845e90245c3891b4;p=thirdparty%2Fkernel%2Flinux.git PCI: Add PCI_VDEVICE_SUB helper macro PCI_VDEVICE_SUB generates the pci_device_id struct layout for the specific PCI device/subdevice. Private data may follow the output. Reviewed-by: Przemek Kitszel Signed-off-by: Piotr Kwapulinski Acked-by: Bjorn Helgaas Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen --- diff --git a/include/linux/pci.h b/include/linux/pci.h index db9b47ce3eefd..414ee5fff66bc 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1046,6 +1046,20 @@ struct pci_driver { .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0 +/** + * PCI_VDEVICE_SUB - describe a specific PCI device/subdevice in a short form + * @vend: the vendor name + * @dev: the 16 bit PCI Device ID + * @subvend: the 16 bit PCI Subvendor ID + * @subdev: the 16 bit PCI Subdevice ID + * + * Generate the pci_device_id struct layout for the specific PCI + * device/subdevice. Private data may follow the output. + */ +#define PCI_VDEVICE_SUB(vend, dev, subvend, subdev) \ + .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \ + .subvendor = (subvend), .subdevice = (subdev), 0, 0 + /** * PCI_DEVICE_DATA - macro used to describe a specific PCI device in very short form * @vend: the vendor name (without PCI_VENDOR_ID_ prefix)