Re: [PATCH v5 30/44] rtc: add HAS_IOPORT dependencies

From: Geert Uytterhoeven
Date: Tue Jul 04 2023 - 04:07:08 EST


Hi Niklas,

On Mon, May 22, 2023 at 12:51 PM Niklas Schnelle <schnelle@xxxxxxxxxxxxx> 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@xxxxxxxxxx>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxxxx>
> Signed-off-by: Niklas Schnelle <schnelle@xxxxxxxxxxxxx>

Thanks for your patch, which is now commit 8bb12adb214b2d7c ("rtc:
add HAS_IOPORT dependencies") upstream.

> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1193,7 +1195,7 @@ config RTC_DRV_MSM6242
>
> config RTC_DRV_BQ4802
> tristate "TI BQ4802"
> - depends on HAS_IOMEM
> + depends on HAS_IOMEM && HAS_IOPORT
> help
> If you say Y here you will get support for the TI
> BQ4802 RTC chip.

This driver can use either iomem or ioport.
By adding a dependency on HAS_IOPORT, it can no longer be used
on platforms that provide HAS_IOMEM only.

Probably the driver should be refactored to make it use only
the accessors that are available.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds