Message ID | 20210825152518.379386-30-miquel.raynal@bootlin.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | TI AM437X ADC1 | expand |
On Wed, 25 Aug 2021 17:25:07 +0200 Miquel Raynal <miquel.raynal@bootlin.com> wrote: > There was in the past a typo in the coordinate readouts property. The > bindings have been updated, the touchscreen driver as well and now > supports both. However, the MFD driver that is in charge of verifying > the validity of the property only checks the bogus one. Add support for > the correctly spelled DT property. > > Fixes: c9aeb249bf72 ("Input: ti_am335x_tsc - fix spelling mistake in TSC/ADC DT binding") > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Ouch. > --- > drivers/mfd/ti_am335x_tscadc.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c > index f4f6b9db4d2a..0bd260edc9ad 100644 > --- a/drivers/mfd/ti_am335x_tscadc.c > +++ b/drivers/mfd/ti_am335x_tscadc.c > @@ -143,7 +143,13 @@ static int ti_tscadc_probe(struct platform_device *pdev) > if (tscadc->data->has_tsc) { > node = of_get_child_by_name(pdev->dev.of_node, "tsc"); > of_property_read_u32(node, "ti,wires", &tscmag_wires); > - of_property_read_u32(node, "ti,coordiante-readouts", &readouts); > + err = of_property_read_u32(node, "ti,coordinate-readouts", > + &readouts); > + if (err < 0) { > + err = of_property_read_u32(node, "ti,coordiante-readouts", > + &readouts); I'm going to guess this will trigger not used warnings for err. > + } > + > if (tscmag_wires) > use_tsc = true; > } else {
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c index f4f6b9db4d2a..0bd260edc9ad 100644 --- a/drivers/mfd/ti_am335x_tscadc.c +++ b/drivers/mfd/ti_am335x_tscadc.c @@ -143,7 +143,13 @@ static int ti_tscadc_probe(struct platform_device *pdev) if (tscadc->data->has_tsc) { node = of_get_child_by_name(pdev->dev.of_node, "tsc"); of_property_read_u32(node, "ti,wires", &tscmag_wires); - of_property_read_u32(node, "ti,coordiante-readouts", &readouts); + err = of_property_read_u32(node, "ti,coordinate-readouts", + &readouts); + if (err < 0) { + err = of_property_read_u32(node, "ti,coordiante-readouts", + &readouts); + } + if (tscmag_wires) use_tsc = true; } else {
There was in the past a typo in the coordinate readouts property. The bindings have been updated, the touchscreen driver as well and now supports both. However, the MFD driver that is in charge of verifying the validity of the property only checks the bogus one. Add support for the correctly spelled DT property. Fixes: c9aeb249bf72 ("Input: ti_am335x_tsc - fix spelling mistake in TSC/ADC DT binding") Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> --- drivers/mfd/ti_am335x_tscadc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)