2021-08-23 09:59:54

by Tang Bin

[permalink] [raw]
Subject: [PATCH] iio: adc: twl6030-gpadc: Use the defined variable to clean code

Use the defined variable "dev" to make the code cleaner.

Signed-off-by: Tang Bin <[email protected]>
---
drivers/iio/adc/twl6030-gpadc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/adc/twl6030-gpadc.c b/drivers/iio/adc/twl6030-gpadc.c
index 0859f3f7d..5e4fbb033 100644
--- a/drivers/iio/adc/twl6030-gpadc.c
+++ b/drivers/iio/adc/twl6030-gpadc.c
@@ -897,7 +897,7 @@ static int twl6030_gpadc_probe(struct platform_device *pdev)

ret = pdata->calibrate(gpadc);
if (ret < 0) {
- dev_err(&pdev->dev, "failed to read calibration registers\n");
+ dev_err(dev, "failed to read calibration registers\n");
return ret;
}

@@ -911,14 +911,14 @@ static int twl6030_gpadc_probe(struct platform_device *pdev)

ret = twl6030_gpadc_enable_irq(TWL6030_GPADC_RT_SW1_EOC_MASK);
if (ret < 0) {
- dev_err(&pdev->dev, "failed to enable GPADC interrupt\n");
+ dev_err(dev, "failed to enable GPADC interrupt\n");
return ret;
}

ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, TWL6030_GPADCS,
TWL6030_REG_TOGGLE1);
if (ret < 0) {
- dev_err(&pdev->dev, "failed to enable GPADC module\n");
+ dev_err(dev, "failed to enable GPADC module\n");
return ret;
}

--
2.20.1.windows.1




2021-08-30 11:31:13

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH] iio: adc: twl6030-gpadc: Use the defined variable to clean code

On Mon, 23 Aug 2021 17:59:21 +0800
Tang Bin <[email protected]> wrote:

> Use the defined variable "dev" to make the code cleaner.
>
> Signed-off-by: Tang Bin <[email protected]>
Applied.

Thanks,

> ---
> drivers/iio/adc/twl6030-gpadc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/adc/twl6030-gpadc.c b/drivers/iio/adc/twl6030-gpadc.c
> index 0859f3f7d..5e4fbb033 100644
> --- a/drivers/iio/adc/twl6030-gpadc.c
> +++ b/drivers/iio/adc/twl6030-gpadc.c
> @@ -897,7 +897,7 @@ static int twl6030_gpadc_probe(struct platform_device *pdev)
>
> ret = pdata->calibrate(gpadc);
> if (ret < 0) {
> - dev_err(&pdev->dev, "failed to read calibration registers\n");
> + dev_err(dev, "failed to read calibration registers\n");
> return ret;
> }
>
> @@ -911,14 +911,14 @@ static int twl6030_gpadc_probe(struct platform_device *pdev)
>
> ret = twl6030_gpadc_enable_irq(TWL6030_GPADC_RT_SW1_EOC_MASK);
> if (ret < 0) {
> - dev_err(&pdev->dev, "failed to enable GPADC interrupt\n");
> + dev_err(dev, "failed to enable GPADC interrupt\n");
> return ret;
> }
>
> ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, TWL6030_GPADCS,
> TWL6030_REG_TOGGLE1);
> if (ret < 0) {
> - dev_err(&pdev->dev, "failed to enable GPADC module\n");
> + dev_err(dev, "failed to enable GPADC module\n");
> return ret;
> }
>