Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] iio: adc: ti-ads1100: fix error code in probe()
@ 2023-03-23 15:23 Dan Carpenter
  2023-04-01 13:37 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-03-23 15:23 UTC (permalink / raw)
  To: Mike Looijmans
  Cc: Lars-Peter Clausen, Andy Shevchenko, linux-iio, kernel-janitors

This code has a copy and paste bug so it accidentally returns
"PTR_ERR(data->reg_vdd)" which is a valid pointer cast to int. It
should return "ret" instead.

Fixes: 541880542f2b ("iio: adc: Add TI ADS1100 and ADS1000")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
 drivers/iio/adc/ti-ads1100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ti-ads1100.c b/drivers/iio/adc/ti-ads1100.c
index 6a478efb108b..6b5aebb82455 100644
--- a/drivers/iio/adc/ti-ads1100.c
+++ b/drivers/iio/adc/ti-ads1100.c
@@ -344,7 +344,7 @@ static int ads1100_probe(struct i2c_client *client)
 
 	ret = regulator_enable(data->reg_vdd);
 	if (ret < 0)
-		return dev_err_probe(dev, PTR_ERR(data->reg_vdd),
+		return dev_err_probe(dev, ret,
 				     "Failed to enable vdd regulator\n");
 
 	ret = devm_add_action_or_reset(dev, ads1100_reg_disable, data->reg_vdd);
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: adc: ti-ads1100: fix error code in probe()
  2023-03-23 15:23 [PATCH] iio: adc: ti-ads1100: fix error code in probe() Dan Carpenter
@ 2023-04-01 13:37 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2023-04-01 13:37 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mike Looijmans, Lars-Peter Clausen, Andy Shevchenko, linux-iio,
	kernel-janitors

On Thu, 23 Mar 2023 18:23:56 +0300
Dan Carpenter <error27@gmail.com> wrote:

> This code has a copy and paste bug so it accidentally returns
> "PTR_ERR(data->reg_vdd)" which is a valid pointer cast to int. It
> should return "ret" instead.
> 
> Fixes: 541880542f2b ("iio: adc: Add TI ADS1100 and ADS1000")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied to the togreg branch of iio.git as this driver is not yet upstream.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ti-ads1100.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ti-ads1100.c b/drivers/iio/adc/ti-ads1100.c
> index 6a478efb108b..6b5aebb82455 100644
> --- a/drivers/iio/adc/ti-ads1100.c
> +++ b/drivers/iio/adc/ti-ads1100.c
> @@ -344,7 +344,7 @@ static int ads1100_probe(struct i2c_client *client)
>  
>  	ret = regulator_enable(data->reg_vdd);
>  	if (ret < 0)
> -		return dev_err_probe(dev, PTR_ERR(data->reg_vdd),
> +		return dev_err_probe(dev, ret,
>  				     "Failed to enable vdd regulator\n");
>  
>  	ret = devm_add_action_or_reset(dev, ads1100_reg_disable, data->reg_vdd);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-01 13:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-23 15:23 [PATCH] iio: adc: ti-ads1100: fix error code in probe() Dan Carpenter
2023-04-01 13:37 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox