diff mbox series

iio: adc: fsl-imx25-gcq: Use the defined variable to clean code

Message ID 20210720125945.11548-1-tangbin@cmss.chinamobile.com (mailing list archive)
State Accepted
Headers show
Series iio: adc: fsl-imx25-gcq: Use the defined variable to clean code | expand

Commit Message

Tang Bin July 20, 2021, 12:59 p.m. UTC
Use the defined variable "dev" to make the code cleaner.

Co-developed-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 drivers/iio/adc/fsl-imx25-gcq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jonathan Cameron July 24, 2021, 3:27 p.m. UTC | #1
On Tue, 20 Jul 2021 20:59:45 +0800
Tang Bin <tangbin@cmss.chinamobile.com> wrote:

> Use the defined variable "dev" to make the code cleaner.
> 
> Co-developed-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>

Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/fsl-imx25-gcq.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
> index d28976f21..01fe5b137 100644
> --- a/drivers/iio/adc/fsl-imx25-gcq.c
> +++ b/drivers/iio/adc/fsl-imx25-gcq.c
> @@ -192,11 +192,11 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
>  	 */
>  	priv->vref[MX25_ADC_REFP_INT] = NULL;
>  	priv->vref[MX25_ADC_REFP_EXT] =
> -		devm_regulator_get_optional(&pdev->dev, "vref-ext");
> +		devm_regulator_get_optional(dev, "vref-ext");
>  	priv->vref[MX25_ADC_REFP_XP] =
> -		devm_regulator_get_optional(&pdev->dev, "vref-xp");
> +		devm_regulator_get_optional(dev, "vref-xp");
>  	priv->vref[MX25_ADC_REFP_YP] =
> -		devm_regulator_get_optional(&pdev->dev, "vref-yp");
> +		devm_regulator_get_optional(dev, "vref-yp");
>  
>  	for_each_child_of_node(np, child) {
>  		u32 reg;
> @@ -298,7 +298,7 @@ static int mx25_gcq_probe(struct platform_device *pdev)
>  	int ret;
>  	int i;
>  
> -	indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv));
> +	indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
>  	if (!indio_dev)
>  		return -ENOMEM;
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
index d28976f21..01fe5b137 100644
--- a/drivers/iio/adc/fsl-imx25-gcq.c
+++ b/drivers/iio/adc/fsl-imx25-gcq.c
@@ -192,11 +192,11 @@  static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
 	 */
 	priv->vref[MX25_ADC_REFP_INT] = NULL;
 	priv->vref[MX25_ADC_REFP_EXT] =
-		devm_regulator_get_optional(&pdev->dev, "vref-ext");
+		devm_regulator_get_optional(dev, "vref-ext");
 	priv->vref[MX25_ADC_REFP_XP] =
-		devm_regulator_get_optional(&pdev->dev, "vref-xp");
+		devm_regulator_get_optional(dev, "vref-xp");
 	priv->vref[MX25_ADC_REFP_YP] =
-		devm_regulator_get_optional(&pdev->dev, "vref-yp");
+		devm_regulator_get_optional(dev, "vref-yp");
 
 	for_each_child_of_node(np, child) {
 		u32 reg;
@@ -298,7 +298,7 @@  static int mx25_gcq_probe(struct platform_device *pdev)
 	int ret;
 	int i;
 
-	indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv));
+	indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
 	if (!indio_dev)
 		return -ENOMEM;