Re: [PATCH] Input: synaptics-rmi4 - make F03 a tristate symbol

From: Dmitry Torokhov
Date: Fri Jan 13 2017 - 16:43:50 EST


On Fri, Jan 13, 2017 at 10:34:32PM +0100, Arnd Bergmann wrote:
> On Fri, Jan 13, 2017 at 10:15 PM, Dmitry Torokhov
> <dmitry.torokhov@xxxxxxxxx> wrote:
> >
> >>This is my fixup, though I'm not too happy with that version.
> >>
> >>Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> >>
> >>diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> >>index 1aeb80e52424..3927259a5d5d 100644
> >>--- a/drivers/hid/Kconfig
> >>+++ b/drivers/hid/Kconfig
> >>@@ -785,7 +785,8 @@ config HID_SUNPLUS
> >> config HID_RMI
> >> tristate "Synaptics RMI4 device support"
> >> depends on HID
> >>- select RMI4_CORE
> >>+ depends on SERIO && RMI4_CORE
> >>+ depends on SERIO=y || RMI4_CORE=SERIO
> >
> > Shouldn't this be simply
> >
> > select SERIO # needed for F03
>
> Ah, I guess this would work too. I didn't consider it because SERIO is
> a user-visible symbol and we generally try not to 'select' them but instead
> use 'depends on.
>
> However, SERIO is already used with 'select' all over the place, so adding
> another select is actually safer than adding a dependency (which could
> cause dependency loops here).
>
> Actually the best solution is probably to have 'select SERIO' in RMI4, like
>
> config RMI4_F03_SERIO
> tristate
> depends on RMI4_CORE
> depends on RMI4_F03
> default RMI4_CORE
> select SERIO
>
> As that avoids the 'depends on SERIO=y || RMI4_CORE=SERIO' statement that
> is different from the other SERIO users, it keeps it all in one place,
> and it doesn't
> prevent you from seeing the RMI4_F03 symbol when SERIO=m.

Hmm, if this works and resilient with user changing symbols after
they've been auto-selected then I like it. How can we run it through
multitude of randconfigs?

Thanks.

--
Dmitry