Re: [PATCH v4 2/3] iio: adc: bcm_iproc_adc: Introduce local device pointer

Markus Elfring <[email protected]> Mon, 3 Aug 2026 14:44:37 +0200
Newsgroups org.kernel.vger.linux-iio,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
=E2=80=A6
> +++ b/drivers/iio/adc/bcm_iproc_adc.c
> @@ -506,9 +506,10 @@ static int iproc_adc_probe(struct platform_device *=
pdev)
>  {
>  	struct iproc_adc_priv *adc_priv;
>  	struct iio_dev *indio_dev =3D NULL;
> +	struct device *dev =3D &pdev->dev;
>  	int ret;
> =20
> -	indio_dev =3D devm_iio_device_alloc(&pdev->dev,
> +	indio_dev =3D devm_iio_device_alloc(dev,
>  					sizeof(*adc_priv));
=E2=80=A6

Would an other adjustment be a bit nicer?

+	indio_dev =3D devm_iio_device_alloc(dev, sizeof(*adc_priv));


=E2=80=A6
> @@ -523,14 +524,14 @@ static int iproc_adc_probe(struct platform_device =
*pdev)
>  	adc_priv->regmap =3D syscon_regmap_lookup_by_phandle(pdev->dev.of_node=
,
>  			   "adc-syscon");
>  	if (IS_ERR(adc_priv->regmap)) {
> -		dev_err(&pdev->dev, "failed to get handle for tsc syscon\n");
> +		dev_err(dev, "failed to get handle for tsc syscon\n");
>  		ret =3D PTR_ERR(adc_priv->regmap);
>  		return ret;
>  	}
=E2=80=A6

Can further source code refinements become helpful here?

Regards,
Markus