summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2025-06-10 13:58:18 +0300
committerBjorn Helgaas <bhelgaas@google.com>2025-08-11 15:00:51 -0500
commit24b2d3c452e5f3facaf9c664aaaa9fc7fa4bc6bb (patch)
tree9506221abf68239852c0c5db5fdc5aa07cd50de9
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585 (diff)
PCI: Use header type defines in pci_setup_device()
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
-rw-r--r--drivers/pci/probe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f41128f91ca7..505e9a602118 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -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);