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

Jonathan Cameron <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <20260805020420.783839fb@jic23-huawei>
On Tue,  4 Aug 2026 22:35:20 +0530
[email protected] wrote:

> From: Mohammad Shahid <[email protected]>
> 
> Introduce a local 'struct device *dev' variable in iproc_adc_probe()
> and use it for device-managed helper calls instead of repeatedly
> referencing '&pdev->dev'.
> 
> No functional change intended.
> 
> Signed-off-by: Mohammad Shahid <[email protected]>
> ---
>  drivers/iio/adc/bcm_iproc_adc.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c
> index 7c2e2770cd61..312be7c12e58 100644
> --- a/drivers/iio/adc/bcm_iproc_adc.c
> +++ b/drivers/iio/adc/bcm_iproc_adc.c
> @@ -506,10 +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,
> -					sizeof(*adc_priv));
> +	indio_dev = devm_iio_device_alloc(dev, sizeof(*adc_priv));
>  	if (!indio_dev)
>  		return -ENOMEM;
>  
> @@ -528,10 +528,9 @@ static int iproc_adc_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	adc_priv->adc_clk = devm_clk_get(&pdev->dev, "tsc_clk");
> +	adc_priv->adc_clk = devm_clk_get(dev, "tsc_clk");
>  	if (IS_ERR(adc_priv->adc_clk)) {
> -		dev_err(&pdev->dev,
> -			"failed getting clock tsc_clk\n");
> +		dev_err(&pdev->dev, "failed getting clock tsc_clk\n");

Don't do the line rewrap here. It is adding noise we don't want
given you are about to replace this line in the next patch.

>  		ret = PTR_ERR(adc_priv->adc_clk);
>  		return ret;
>  	}
> @@ -547,7 +546,7 @@ static int iproc_adc_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	ret = devm_request_threaded_irq(&pdev->dev, adc_priv->irqno,
> +	ret = devm_request_threaded_irq(dev, adc_priv->irqno,
>  				iproc_adc_interrupt_handler,
>  				iproc_adc_interrupt_thread,
>  				IRQF_SHARED, "iproc-adc", indio_dev);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.