diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2023-08-29 18:03:49 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2023-08-29 18:03:49 +0200 |
commit | d4a0f52c962f048821b2c89b48a6e6808d65aab9 (patch) | |
tree | ae1c3e0e144abbce24d77af8d2ed0270988c6526 | |
parent | Merge branch 'pci/hotplug' (diff) | |
parent | PCI/sysfs: Make I/O resource depend on HAS_IOPORT (diff) | |
download | linux-d4a0f52c962f048821b2c89b48a6e6808d65aab9.tar.xz linux-d4a0f52c962f048821b2c89b48a6e6808d65aab9.zip |
Merge branch 'pci/ioport'
- Make I/O resources depend on CONFIG_HAS_IOPORT so inw() and friends can
be completely omitted on architectures without I/O port support (Niklas
Schnelle)
* pci/ioport:
PCI/sysfs: Make I/O resource depend on HAS_IOPORT
PCI: Make quirk using inw() depend on HAS_IOPORT
-rw-r--r-- | drivers/pci/pci-sysfs.c | 4 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index ab32a91f287b..d9eede2dbc0e 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -1083,6 +1083,7 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count, bool write) { +#ifdef CONFIG_HAS_IOPORT struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj)); int bar = (unsigned long)attr->private; unsigned long port = off; @@ -1116,6 +1117,9 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj, return 4; } return -EINVAL; +#else + return -ENXIO; +#endif } static ssize_t pci_read_resource_io(struct file *filp, struct kobject *kobj, diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 321156ca273d..ef193661c3d1 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -361,6 +361,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_d DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs); #endif +#ifdef CONFIG_HAS_IOPORT /* * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear * for some HT machines to use C4 w/o hanging. @@ -380,6 +381,7 @@ static void quirk_tigerpoint_bm_sts(struct pci_dev *dev) } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts); +#endif /* Chipsets where PCI->PCI transfers vanish or hang */ static void quirk_nopcipci(struct pci_dev *dev) |