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

misc: add HAS_IOPORT dependencies

In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
not being declared. We thus need to add HAS_IOPORT as dependency for
those drivers using them.

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>
Link: https://lore.kernel.org/r/20230516110038.2413224-18-schnelle@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Niklas Schnelle and committed by
Greg Kroah-Hartman
128f20c0 f050bb8f

+7 -2
+2 -1
drivers/misc/altera-stapl/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - altera-stapl-objs = altera-lpt.o altera-jtag.o altera-comp.o altera.o 2 + altera-stapl-y = altera-jtag.o altera-comp.o altera.o 3 + altera-stapl-$(CONFIG_HAS_IOPORT) += altera-lpt.o 3 4 4 5 obj-$(CONFIG_ALTERA_STAPL) += altera-stapl.o
+5 -1
drivers/misc/altera-stapl/altera.c
··· 2407 2407 2408 2408 astate->config = config; 2409 2409 if (!astate->config->jtag_io) { 2410 + if (!IS_ENABLED(CONFIG_HAS_IOPORT)) { 2411 + retval = -ENODEV; 2412 + goto free_state; 2413 + } 2410 2414 dprintk("%s: using byteblaster!\n", __func__); 2411 2415 astate->config->jtag_io = netup_jtag_io_lpt; 2412 2416 } ··· 2485 2481 2486 2482 } else if (exec_result) 2487 2483 printk(KERN_ERR "%s: error %d\n", __func__, exec_result); 2488 - 2484 + free_state: 2489 2485 kfree(astate); 2490 2486 free_value: 2491 2487 kfree(value);