Skip to content

Commit d4a0f52

Browse files
committed
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
2 parents 6ab23de + 5da1b58 commit d4a0f52

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/pci/pci-sysfs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj,
10831083
struct bin_attribute *attr, char *buf,
10841084
loff_t off, size_t count, bool write)
10851085
{
1086+
#ifdef CONFIG_HAS_IOPORT
10861087
struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
10871088
int bar = (unsigned long)attr->private;
10881089
unsigned long port = off;
@@ -1116,6 +1117,9 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj,
11161117
return 4;
11171118
}
11181119
return -EINVAL;
1120+
#else
1121+
return -ENXIO;
1122+
#endif
11191123
}
11201124

11211125
static ssize_t pci_read_resource_io(struct file *filp, struct kobject *kobj,

drivers/pci/quirks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_d
361361
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs);
362362
#endif
363363

364+
#ifdef CONFIG_HAS_IOPORT
364365
/*
365366
* Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear
366367
* for some HT machines to use C4 w/o hanging.
@@ -380,6 +381,7 @@ static void quirk_tigerpoint_bm_sts(struct pci_dev *dev)
380381
}
381382
}
382383
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts);
384+
#endif
383385

384386
/* Chipsets where PCI->PCI transfers vanish or hang */
385387
static void quirk_nopcipci(struct pci_dev *dev)

0 commit comments

Comments
 (0)