mbox series

[v2,0/5] mfd: stmpe: Probe sub-function by compatible

Message ID 20220712163345.445811-1-francesco.dolcini@toradex.com
Headers show
Series mfd: stmpe: Probe sub-function by compatible | expand

Message

Francesco Dolcini July 12, 2022, 4:33 p.m. UTC
Hi all,
This series update the STMPE MFD driver to use of_compatible to probe for
sub-functions instead of using hardcoded names.  Matching by name does not seems
in general a good idea, in this specific case it is even worst since the node
name are not compliant to the current naming convention (they are not generic
and they do include underscores), and because of that recently
we had a regression introduced [1].

This change was suggested by Ahmad Fatoum [2].

[1] commit 56086b5e ("ARM: dts: imx6qdl-apalis: Avoid underscore in node name")
[2] https://lore.kernel.org/all/86815346-209e-304e-3565-b4160afa48e8@pengutronix.de/

Changes in v2:
 - split in a separate patch the removal of rotator from probe
 - remove define usage for compatible strings

Francesco Dolcini (5):
  mfd: stmpe: Remove rotator block from probe
  mfd: stmpe: Probe sub-function by compatible
  dt-bindings: gpio: stmpe: Remove node name requirement
  dt-bindings: iio: adc: stmpe: Remove node name requirement
  dt-bindings: input: touchscreen: stmpe: Remove node name requirement

 .../devicetree/bindings/gpio/gpio-stmpe.txt         |  3 +--
 .../devicetree/bindings/iio/adc/st,stmpe-adc.yaml   |  3 +--
 .../devicetree/bindings/input/touchscreen/stmpe.txt |  3 +--
 drivers/mfd/stmpe.c                                 | 13 +++++--------
 4 files changed, 8 insertions(+), 14 deletions(-)

Comments

Linus Walleij July 18, 2022, 9:20 a.m. UTC | #1
On Tue, Jul 12, 2022 at 6:36 PM Francesco Dolcini
<francesco.dolcini@toradex.com> wrote:

> Use sub-function of_compatible during probe, instead of using the node
> name. The code should not rely on the node names during probe, in
> addition to that the previously hard-coded node names are not compliant
> to the latest naming convention (they are not generic and they use
> underscores), and it was broken by mistake already once [1].
>
> [1] commit 56086b5e804f ("ARM: dts: imx6qdl-apalis: Avoid underscore in node name")
>
> Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
> v2:
>  - remove define usage for compatible strings
>  - moved rotator removal from probe to a separate patch

v2 LGTM
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Lee Jones Aug. 8, 2022, 3:17 p.m. UTC | #2
On Tue, 12 Jul 2022, Francesco Dolcini wrote:

> Remove rotator block from probe, it is not used in any device tree file,
> there is no related cell defined, it's just dead non-working code with no
> of_compatible for it.
> 
> This is a preliminary change to allow probing by of_compatible and not
> by a fixed name.
> 
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
> v2:
>  - new patch
> ---
>  drivers/mfd/stmpe.c | 2 --
>  1 file changed, 2 deletions(-)

Applied, thanks.
Lee Jones Aug. 8, 2022, 3:18 p.m. UTC | #3
On Tue, 12 Jul 2022, Francesco Dolcini wrote:

> Use sub-function of_compatible during probe, instead of using the node
> name. The code should not rely on the node names during probe, in
> addition to that the previously hard-coded node names are not compliant
> to the latest naming convention (they are not generic and they use
> underscores), and it was broken by mistake already once [1].
> 
> [1] commit 56086b5e804f ("ARM: dts: imx6qdl-apalis: Avoid underscore in node name")
> 
> Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
> v2:
>  - remove define usage for compatible strings
>  - moved rotator removal from probe to a separate patch
> ---
>  drivers/mfd/stmpe.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

Applied, thanks.
Francesco Dolcini Aug. 9, 2022, 7:54 a.m. UTC | #4
Hello Lee,
thanks for picking up patches 1 and 2. What about the others, should you
pick also those? 3 and 4 do have all the required acks, I'm not sure
about 5 however that has the ack only from Krzysztof.

Francesco

On Tue, Jul 12, 2022 at 06:33:40PM +0200, Francesco Dolcini wrote:
> Hi all,
> This series update the STMPE MFD driver to use of_compatible to probe for
> sub-functions instead of using hardcoded names.  Matching by name does not seems
> in general a good idea, in this specific case it is even worst since the node
> name are not compliant to the current naming convention (they are not generic
> and they do include underscores), and because of that recently
> we had a regression introduced [1].
Lee Jones Aug. 9, 2022, 1:38 p.m. UTC | #5
On Tue, 09 Aug 2022, Francesco Dolcini wrote:

> Hello Lee,
> thanks for picking up patches 1 and 2. What about the others, should you
> pick also those? 3 and 4 do have all the required acks, I'm not sure
> about 5 however that has the ack only from Krzysztof.

They need to go in via their own subsystems.

We only filter in patches from other areas if there are build deps.