Re: [PATCH 28/28] mfd: ti_am335x_tscadc: Remove redundant ti_tscadc_dev_get() helper

From: Jonathan Cameron

Date: Wed Oct 21 2026 - 15:20:42 EST


On Wed, 21 Oct 2026 12:09:50 +0000
Lee Jones <lee@xxxxxxxxxx> wrote:

> Now that ti_tscadc_dev_get() is a single-line wrapper around
> dev_get_drvdata(p->dev.parent), remove the bespoke helper and retrieve
> the parent driver data directly in the child ADC and touchscreen
> drivers.
>
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
Acked-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>

Seems moderately unlikely we will get a flurry of activity on
this driver and if we do merge conflicts should be minimal
so no need for an immutable I think.

J
> ---
> drivers/iio/adc/ti_am335x_adc.c | 2 +-
> drivers/input/touchscreen/ti_am335x_tsc.c | 2 +-
> include/linux/mfd/ti_am335x_tscadc.h | 5 -----
> 3 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
> index 1516dd332f90..77ea59d6c6b7 100644
> --- a/drivers/iio/adc/ti_am335x_adc.c
> +++ b/drivers/iio/adc/ti_am335x_adc.c
> @@ -636,7 +636,7 @@ static int tiadc_probe(struct platform_device *pdev)
>
> adc_dev = iio_priv(indio_dev);
>
> - adc_dev->mfd_tscadc = ti_tscadc_dev_get(pdev);
> + adc_dev->mfd_tscadc = dev_get_drvdata(pdev->dev.parent);
> tiadc_parse_dt(pdev, adc_dev);
>
> indio_dev->name = dev_name(&pdev->dev);
> diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
> index 623546e80668..40ffdec9d207 100644
> --- a/drivers/input/touchscreen/ti_am335x_tsc.c
> +++ b/drivers/input/touchscreen/ti_am335x_tsc.c
> @@ -418,7 +418,7 @@ static int titsc_probe(struct platform_device *pdev)
> {
> struct titsc *ts_dev;
> struct input_dev *input_dev;
> - struct ti_tscadc_dev *tscadc_dev = ti_tscadc_dev_get(pdev);
> + struct ti_tscadc_dev *tscadc_dev = dev_get_drvdata(pdev->dev.parent);
> int err;
>
> /* Allocate memory for device */
> diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
> index 4a048a897cf3..36d365b64fe6 100644
> --- a/include/linux/mfd/ti_am335x_tscadc.h
> +++ b/include/linux/mfd/ti_am335x_tscadc.h
> @@ -175,11 +175,6 @@ struct ti_tscadc_dev {
> struct adc_device *adc;
> };
>
> -static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)
> -{
> - return dev_get_drvdata(p->dev.parent);
> -}
> -
> static inline bool ti_adc_with_touchscreen(struct ti_tscadc_dev *tscadc)
> {
> return of_device_is_compatible(tscadc->dev->of_node,