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

From: Markus Elfring

Date: Mon Aug 03 2026 - 09:03:17 EST



> +++ 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 = NULL;
> + struct device *dev = &pdev->dev;
> int ret;
>
> - indio_dev = devm_iio_device_alloc(&pdev->dev,
> + indio_dev = devm_iio_device_alloc(dev,
> sizeof(*adc_priv));


Would an other adjustment be a bit nicer?

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



> @@ -523,14 +524,14 @@ static int iproc_adc_probe(struct platform_device *pdev)
> adc_priv->regmap = 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 = PTR_ERR(adc_priv->regmap);
> return ret;
> }


Can further source code refinements become helpful here?

Regards,
Markus