Skip to content

Commit 208fff3

Browse files
pkwapulianguy11
authored andcommitted
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 <[email protected]> Signed-off-by: Piotr Kwapulinski <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 4600cdf commit 208fff3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

include/linux/pci.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,20 @@ struct pci_driver {
10461046
.vendor = PCI_VENDOR_ID_##vend, .device = (dev), \
10471047
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0
10481048

1049+
/**
1050+
* PCI_VDEVICE_SUB - describe a specific PCI device/subdevice in a short form
1051+
* @vend: the vendor name
1052+
* @dev: the 16 bit PCI Device ID
1053+
* @subvend: the 16 bit PCI Subvendor ID
1054+
* @subdev: the 16 bit PCI Subdevice ID
1055+
*
1056+
* Generate the pci_device_id struct layout for the specific PCI
1057+
* device/subdevice. Private data may follow the output.
1058+
*/
1059+
#define PCI_VDEVICE_SUB(vend, dev, subvend, subdev) \
1060+
.vendor = PCI_VENDOR_ID_##vend, .device = (dev), \
1061+
.subvendor = (subvend), .subdevice = (subdev), 0, 0
1062+
10491063
/**
10501064
* PCI_DEVICE_DATA - macro used to describe a specific PCI device in very short form
10511065
* @vend: the vendor name (without PCI_VENDOR_ID_ prefix)

0 commit comments

Comments
 (0)