]> www.infradead.org Git - users/hch/misc.git/commitdiff
PCI: Use header type defines in pci_setup_device()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 10 Jun 2025 10:58:18 +0000 (13:58 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 11 Aug 2025 20:00:51 +0000 (15:00 -0500)
Replace literals with PCI_HEADER_TYPE_* defines in pci_setup_device().

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://patch.msgid.link/20250610105820.7126-1-ilpo.jarvinen@linux.intel.com
drivers/pci/probe.c

index f41128f91ca76ab014ad669ae84a53032c7c6b6b..505e9a6021187ee2b413b8811d91875eb388eec4 100644 (file)
@@ -1985,8 +1985,8 @@ int pci_setup_device(struct pci_dev *dev)
        dev->sysdata = dev->bus->sysdata;
        dev->dev.parent = dev->bus->bridge;
        dev->dev.bus = &pci_bus_type;
-       dev->hdr_type = hdr_type & 0x7f;
-       dev->multifunction = !!(hdr_type & 0x80);
+       dev->hdr_type = FIELD_GET(PCI_HEADER_TYPE_MASK, hdr_type);
+       dev->multifunction = FIELD_GET(PCI_HEADER_TYPE_MFD, hdr_type);
        dev->error_state = pci_channel_io_normal;
        set_pcie_port_type(dev);