Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Niklas Schnelle and committed by
Corey Minyard
c5c76d80 a9b5bb5c

+9 -8
+4 -7
drivers/char/ipmi/Makefile
··· 5 5 6 6 ipmi_si-y := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o \ 7 7 ipmi_si_hotmod.o ipmi_si_hardcode.o ipmi_si_platform.o \ 8 - ipmi_si_port_io.o ipmi_si_mem_io.o 9 - ifdef CONFIG_PCI 10 - ipmi_si-y += ipmi_si_pci.o 11 - endif 12 - ifdef CONFIG_PARISC 13 - ipmi_si-y += ipmi_si_parisc.o 14 - endif 8 + ipmi_si_mem_io.o 9 + ipmi_si-$(CONFIG_HAS_IOPORT) += ipmi_si_port_io.o 10 + ipmi_si-$(CONFIG_PCI) += ipmi_si_pci.o 11 + ipmi_si-$(CONFIG_PARISC) += ipmi_si_parisc.o 15 12 16 13 obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o 17 14 obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o
+2 -1
drivers/char/ipmi/ipmi_si_intf.c
··· 1882 1882 } 1883 1883 1884 1884 if (!io->io_setup) { 1885 - if (io->addr_space == IPMI_IO_ADDR_SPACE) { 1885 + if (IS_ENABLED(CONFIG_HAS_IOPORT) && 1886 + io->addr_space == IPMI_IO_ADDR_SPACE) { 1886 1887 io->io_setup = ipmi_si_port_setup; 1887 1888 } else if (io->addr_space == IPMI_MEM_ADDR_SPACE) { 1888 1889 io->io_setup = ipmi_si_mem_setup;
+3
drivers/char/ipmi/ipmi_si_pci.c
··· 97 97 } 98 98 99 99 if (pci_resource_flags(pdev, 0) & IORESOURCE_IO) { 100 + if (!IS_ENABLED(CONFIG_HAS_IOPORT)) 101 + return -ENXIO; 102 + 100 103 io.addr_space = IPMI_IO_ADDR_SPACE; 101 104 io.io_setup = ipmi_si_port_setup; 102 105 } else {