diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2023-10-28 13:30:58 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2023-10-28 13:30:58 -0500 |
commit | 553b84bf467746b95f893f1bb92b143674a1aaf0 (patch) | |
tree | 03c121526da55c6f2c131b75910d61f2c02cde91 /drivers/pci/quirks.c | |
parent | 4eccbed8f48c6cdcfe97b76be2b36d69e8f0845a (diff) | |
parent | 7994db905c0fd692cf04c527585f08a91b560144 (diff) |
Merge branch 'pci/enumeration'
- Add and use pci_get_base_class() to search for all PCI_BASE_CLASS_DISPLAY
devices (Sui Jingfeng)
- Fix a vmd check for multi-function devices (Ilpo Järvinen)
- Add PCI_HEADER_TYPE_MFD and use it to replace literals (Ilpo Järvinen)
- Use acpi_evaluate_dsm_typed() instead of open-coding it (Andy Shevchenko)
- Keep .remove() and .probe() callbacks (previously marked __init) in case
they're used via sysfs (Uwe Kleine-König)
* pci/enumeration:
PCI: keystone: Don't discard .probe() callback
PCI: keystone: Don't discard .remove() callback
PCI: kirin: Don't discard .remove() callback
PCI: exynos: Don't discard .remove() callback
PCI/ACPI: Use acpi_evaluate_dsm_typed()
PCI: Use PCI_HEADER_TYPE_* instead of literals
PCI: Add PCI_HEADER_TYPE_MFD definition
PCI: vmd: Correct PCI Header Type Register's multi-function check
drm/radeon: Use pci_get_base_class() to reduce duplicated code
drm/amdgpu: Use pci_get_base_class() to reduce duplicated code
drm/nouveau: Use pci_get_base_class() to reduce duplicated code
ALSA: hda: Use pci_get_base_class() to reduce duplicated code
PCI: Add pci_get_base_class() helper
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 8246074ea530..b041211b1fdb 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -1844,8 +1844,8 @@ static void quirk_jmicron_ata(struct pci_dev *pdev) /* Update pdev accordingly */ pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr); - pdev->hdr_type = hdr & 0x7f; - pdev->multifunction = !!(hdr & 0x80); + pdev->hdr_type = hdr & PCI_HEADER_TYPE_MASK; + pdev->multifunction = FIELD_GET(PCI_HEADER_TYPE_MFD, hdr); pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class); pdev->class = class >> 8; @@ -5687,7 +5687,7 @@ static void quirk_nvidia_hda(struct pci_dev *gpu) /* The GPU becomes a multi-function device when the HDA is enabled */ pci_read_config_byte(gpu, PCI_HEADER_TYPE, &hdr_type); - gpu->multifunction = !!(hdr_type & 0x80); + gpu->multifunction = FIELD_GET(PCI_HEADER_TYPE_MFD, hdr_type); } DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY, 16, quirk_nvidia_hda); |