diff mbox series

[v3,05/38] counter: add HAS_IOPORT dependencies

Message ID 20230314121216.413434-6-schnelle@linux.ibm.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Kconfig: Introduce HAS_IOPORT config option | expand

Commit Message

Niklas Schnelle March 14, 2023, 12:11 p.m. UTC
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: Niklas Schnelle <schnelle@linux.ibm.com>
---
 drivers/counter/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

William Breathitt Gray March 14, 2023, 12:41 p.m. UTC | #1
On Tue, Mar 14, 2023 at 01:11:43PM +0100, Niklas Schnelle wrote:
> 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: Niklas Schnelle <schnelle@linux.ibm.com>
> ---
>  drivers/counter/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/counter/Kconfig b/drivers/counter/Kconfig
> index b5ba8fb02cf7..1cae5097217e 100644
> --- a/drivers/counter/Kconfig
> +++ b/drivers/counter/Kconfig
> @@ -15,6 +15,7 @@ if COUNTER
>  config 104_QUAD_8
>  	tristate "ACCES 104-QUAD-8 driver"
>  	depends on (PC104 && X86) || COMPILE_TEST
> +	depends on HAS_IOPORT
>  	select ISA_BUS_API
>  	help
>  	  Say yes here to build support for the ACCES 104-QUAD-8 quadrature
> -- 
> 2.37.2

Is HAS_IOPORT needed because this driver uses devm_ioport_map()? The
inb()/outb() functions and such are not used in this driver, so would it
suffice to depend on HAS_IOPORT_MAP instead?

William Breathitt Gray
Niklas Schnelle April 28, 2023, 1:27 p.m. UTC | #2
On Tue, 2023-03-14 at 08:41 -0400, William Breathitt Gray wrote:
> On Tue, Mar 14, 2023 at 01:11:43PM +0100, Niklas Schnelle wrote:
> > 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: Niklas Schnelle <schnelle@linux.ibm.com>
> > ---
> >  drivers/counter/Kconfig | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/counter/Kconfig b/drivers/counter/Kconfig
> > index b5ba8fb02cf7..1cae5097217e 100644
> > --- a/drivers/counter/Kconfig
> > +++ b/drivers/counter/Kconfig
> > @@ -15,6 +15,7 @@ if COUNTER
> >  config 104_QUAD_8
> >  	tristate "ACCES 104-QUAD-8 driver"
> >  	depends on (PC104 && X86) || COMPILE_TEST
> > +	depends on HAS_IOPORT
> >  	select ISA_BUS_API
> >  	help
> >  	  Say yes here to build support for the ACCES 104-QUAD-8 quadrature
> > -- 
> > 2.37.2
> 
> Is HAS_IOPORT needed because this driver uses devm_ioport_map()? The
> inb()/outb() functions and such are not used in this driver, so would it
> suffice to depend on HAS_IOPORT_MAP instead?
> 
> William Breathitt Gray

Yes, good catch HAS_IOPORT_MAP indeed seems to be enough. Will be
changed in v4. Thankfully the Kconfig change to add HAS_IOPORT has
already landed in Linus' tree so for the future these per subsystem
patches can be merged independently.

Thanks,
Niklas
diff mbox series

Patch

diff --git a/drivers/counter/Kconfig b/drivers/counter/Kconfig
index b5ba8fb02cf7..1cae5097217e 100644
--- a/drivers/counter/Kconfig
+++ b/drivers/counter/Kconfig
@@ -15,6 +15,7 @@  if COUNTER
 config 104_QUAD_8
 	tristate "ACCES 104-QUAD-8 driver"
 	depends on (PC104 && X86) || COMPILE_TEST
+	depends on HAS_IOPORT
 	select ISA_BUS_API
 	help
 	  Say yes here to build support for the ACCES 104-QUAD-8 quadrature