2023-09-13 12:16:47

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 05/13] comedi: 8255_pci: Conditionally remove devices that use port I/O

On Wed, Sep 13, 2023, at 13:20, Ian Abbott wrote:
> 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 8255_pci module supports PCI digital I/O devices from various
> manufacturers that consist of one or more 8255 Programmable Peripheral
> Interface chips (or equivalent hardware) to provide their digital I/O
> ports. Some of the devices use port I/O and some only use memory-mapped
> I/O.
>
> Conditionally compile in support for the devices that need port I/O if
> and only if the `CONFIG_HAS_PORTIO` macro is defined. Change
> `pci_8255_auto_attach()` to return an error if the device actually
> requires port I/O (based on the PCI BAR resource flags) but the
> `HAS_IOPORT` configuration is not enabled.
>
> Cc: Arnd Bergmann <[email protected]>
> Cc: Niklas Schnelle <[email protected]>
> Signed-off-by: Ian Abbott <[email protected]>
> ---
> drivers/comedi/drivers/8255_pci.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/comedi/drivers/8255_pci.c
> b/drivers/comedi/drivers/8255_pci.c
> index 0fec048e3a53..4c4c0ef1db05 100644
> --- a/drivers/comedi/drivers/8255_pci.c
> +++ b/drivers/comedi/drivers/8255_pci.c
> @@ -57,6 +57,7 @@
> #include <linux/comedi/comedi_8255.h>
>
> enum pci_8255_boardid {
> +#ifdef CONFIG_HAS_PORTIO

I think this is a typo: HAS_IOPORT vs HAS_PORTIO?

Arnd


2023-09-13 16:40:49

by Ian Abbott

[permalink] [raw]
Subject: Re: [PATCH 05/13] comedi: 8255_pci: Conditionally remove devices that use port I/O

On 13/09/2023 13:03, Arnd Bergmann wrote:
> On Wed, Sep 13, 2023, at 13:20, Ian Abbott wrote:
>> 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 8255_pci module supports PCI digital I/O devices from various
>> manufacturers that consist of one or more 8255 Programmable Peripheral
>> Interface chips (or equivalent hardware) to provide their digital I/O
>> ports. Some of the devices use port I/O and some only use memory-mapped
>> I/O.
>>
>> Conditionally compile in support for the devices that need port I/O if
>> and only if the `CONFIG_HAS_PORTIO` macro is defined. Change
>> `pci_8255_auto_attach()` to return an error if the device actually
>> requires port I/O (based on the PCI BAR resource flags) but the
>> `HAS_IOPORT` configuration is not enabled.
>>
>> Cc: Arnd Bergmann <[email protected]>
>> Cc: Niklas Schnelle <[email protected]>
>> Signed-off-by: Ian Abbott <[email protected]>
>> ---
>> drivers/comedi/drivers/8255_pci.c | 11 ++++++++++-
>> 1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/comedi/drivers/8255_pci.c
>> b/drivers/comedi/drivers/8255_pci.c
>> index 0fec048e3a53..4c4c0ef1db05 100644
>> --- a/drivers/comedi/drivers/8255_pci.c
>> +++ b/drivers/comedi/drivers/8255_pci.c
>> @@ -57,6 +57,7 @@
>> #include <linux/comedi/comedi_8255.h>
>>
>> enum pci_8255_boardid {
>> +#ifdef CONFIG_HAS_PORTIO
>
> I think this is a typo: HAS_IOPORT vs HAS_PORTIO?
>
> Arnd

Oops! Well-spotted. Actually, this affects several of the patches!

--
-=( Ian Abbott <[email protected]> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || http://www.mev.co.uk )=-