Commit c5c76d80 authored by Niklas Schnelle's avatar Niklas Schnelle Committed by Corey Minyard

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: default avatarCorey Minyard <cminyard@mvista.com>
Co-developed-by: default avatarArnd Bergmann <arnd@kernel.org>
Signed-off-by: default avatarArnd Bergmann <arnd@kernel.org>
Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
Message-Id: <20240404104506.3352637-2-schnelle@linux.ibm.com>
Signed-off-by: default avatarCorey Minyard <minyard@acm.org>
parent a9b5bb5c
...@@ -5,13 +5,10 @@ ...@@ -5,13 +5,10 @@
ipmi_si-y := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o \ ipmi_si-y := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o \
ipmi_si_hotmod.o ipmi_si_hardcode.o ipmi_si_platform.o \ ipmi_si_hotmod.o ipmi_si_hardcode.o ipmi_si_platform.o \
ipmi_si_port_io.o ipmi_si_mem_io.o ipmi_si_mem_io.o
ifdef CONFIG_PCI ipmi_si-$(CONFIG_HAS_IOPORT) += ipmi_si_port_io.o
ipmi_si-y += ipmi_si_pci.o ipmi_si-$(CONFIG_PCI) += ipmi_si_pci.o
endif ipmi_si-$(CONFIG_PARISC) += ipmi_si_parisc.o
ifdef CONFIG_PARISC
ipmi_si-y += ipmi_si_parisc.o
endif
obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o
obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o
......
...@@ -1882,7 +1882,8 @@ int ipmi_si_add_smi(struct si_sm_io *io) ...@@ -1882,7 +1882,8 @@ int ipmi_si_add_smi(struct si_sm_io *io)
} }
if (!io->io_setup) { if (!io->io_setup) {
if (io->addr_space == IPMI_IO_ADDR_SPACE) { if (IS_ENABLED(CONFIG_HAS_IOPORT) &&
io->addr_space == IPMI_IO_ADDR_SPACE) {
io->io_setup = ipmi_si_port_setup; io->io_setup = ipmi_si_port_setup;
} else if (io->addr_space == IPMI_MEM_ADDR_SPACE) { } else if (io->addr_space == IPMI_MEM_ADDR_SPACE) {
io->io_setup = ipmi_si_mem_setup; io->io_setup = ipmi_si_mem_setup;
......
...@@ -97,6 +97,9 @@ static int ipmi_pci_probe(struct pci_dev *pdev, ...@@ -97,6 +97,9 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
} }
if (pci_resource_flags(pdev, 0) & IORESOURCE_IO) { if (pci_resource_flags(pdev, 0) & IORESOURCE_IO) {
if (!IS_ENABLED(CONFIG_HAS_IOPORT))
return -ENXIO;
io.addr_space = IPMI_IO_ADDR_SPACE; io.addr_space = IPMI_IO_ADDR_SPACE;
io.io_setup = ipmi_si_port_setup; io.io_setup = ipmi_si_port_setup;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment