summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/ipmi_si_pci.c
diff options
context:
space:
mode:
authorNiklas Schnelle <schnelle@linux.ibm.com>2024-04-04 12:45:06 +0200
committerCorey Minyard <minyard@acm.org>2024-04-17 14:55:04 -0500
commitc5c76d800a646e08890cb775efd6037008136b9e (patch)
tree2c84c9b5cf16a7e952ee8a6c2f19e7ed8e5d1c26 /drivers/char/ipmi/ipmi_si_pci.c
parenta9b5bb5c2222b90f30c37c6036664b96404ab369 (diff)
char: ipmi: handle HAS_IOPORT dependencies
In a future patch HAS_IOPORT=n will disable inb()/outb() and friends at compile time. We thus need to add this dependency and ifdef sections of code using inb()/outb() as alternative access methods. Acked-by: Corey Minyard <cminyard@mvista.com> Co-developed-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Message-Id: <20240404104506.3352637-2-schnelle@linux.ibm.com> Signed-off-by: Corey Minyard <minyard@acm.org>
Diffstat (limited to 'drivers/char/ipmi/ipmi_si_pci.c')
-rw-r--r--drivers/char/ipmi/ipmi_si_pci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/ipmi/ipmi_si_pci.c b/drivers/char/ipmi/ipmi_si_pci.c
index 74fa2055868b..b83d55685b22 100644
--- a/drivers/char/ipmi/ipmi_si_pci.c
+++ b/drivers/char/ipmi/ipmi_si_pci.c
@@ -97,6 +97,9 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
}
if (pci_resource_flags(pdev, 0) & IORESOURCE_IO) {
+ if (!IS_ENABLED(CONFIG_HAS_IOPORT))
+ return -ENXIO;
+
io.addr_space = IPMI_IO_ADDR_SPACE;
io.io_setup = ipmi_si_port_setup;
} else {