Skip to content

Commit c5c76d8

Browse files
niklas88cminyard
authored andcommitted
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>
1 parent a9b5bb5 commit c5c76d8

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

drivers/char/ipmi/Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@
55

66
ipmi_si-y := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o \
77
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
1512

1613
obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o
1714
obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o

drivers/char/ipmi/ipmi_si_intf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,8 @@ int ipmi_si_add_smi(struct si_sm_io *io)
18821882
}
18831883

18841884
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) {
18861887
io->io_setup = ipmi_si_port_setup;
18871888
} else if (io->addr_space == IPMI_MEM_ADDR_SPACE) {
18881889
io->io_setup = ipmi_si_mem_setup;

drivers/char/ipmi/ipmi_si_pci.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
9797
}
9898

9999
if (pci_resource_flags(pdev, 0) & IORESOURCE_IO) {
100+
if (!IS_ENABLED(CONFIG_HAS_IOPORT))
101+
return -ENXIO;
102+
100103
io.addr_space = IPMI_IO_ADDR_SPACE;
101104
io.io_setup = ipmi_si_port_setup;
102105
} else {

0 commit comments

Comments
 (0)