diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2023-09-13 20:07:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-05 14:34:04 +0300 |
commit | 7187a0939a1773e6a2663a02a6c456047a5e6289 (patch) | |
tree | 5344405eba33010fc6cd5da702898e3fe1191922 /include | |
parent | 5c57b1ccecc72738d4b9be2dfcdfb9001be76bd7 (diff) | |
download | linux-7187a0939a1773e6a2663a02a6c456047a5e6289.tar.xz |
comedi: comedi_8255: Conditionally remove I/O port support
In a future patch, the port I/O functions (`inb()`, `outb()`, and
friends will only be declared in the `HAS_IOPORT` configuration option
is enabled.
The comedi_8255 module supports both port I/O and memory-mapped I/O.
Conditionally compile the parts of the module that use port I/O if and
only if the `CONFIG_HAS_IOPORT` macro is defined so that it can still be
built if the port I/O functions have not been declared. If the
`CONFIG_HAS_IOPORT` macro is undefined, replace the GPL-exported
`subdev_8255_io_init()` function with a dummy static inline version that
just returns `-ENXIO`.
Cc: Arnd Bergmann <arnd@kernel.org>
Cc: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20230913170712.111719-8-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/comedi/comedi_8255.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/comedi/comedi_8255.h b/include/linux/comedi/comedi_8255.h index b396fcfbf8b0..d24a69da389b 100644 --- a/include/linux/comedi/comedi_8255.h +++ b/include/linux/comedi/comedi_8255.h @@ -10,6 +10,8 @@ #ifndef _COMEDI_8255_H #define _COMEDI_8255_H +#include <linux/errno.h> + #define I8255_SIZE 0x04 #define I8255_DATA_A_REG 0x00 @@ -27,8 +29,17 @@ struct comedi_device; struct comedi_subdevice; +#ifdef CONFIG_HAS_IOPORT int subdev_8255_io_init(struct comedi_device *dev, struct comedi_subdevice *s, unsigned long regbase); +#else +static inline int subdev_8255_io_init(struct comedi_device *dev, + struct comedi_subdevice *s, + unsigned long regbase) +{ + return -ENXIO; +} +#endif int subdev_8255_mm_init(struct comedi_device *dev, struct comedi_subdevice *s, unsigned long regbase); |