Skip to contentSkip to conversation

iio: dac: ad5504: Don't set error code to voltage_uv

PATCH In review Axel Lin 2 participants 4 messages Dec 14, 2012 – Dec 16, 2012

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH v2 3/6 iio: dac: ad5504: Don't set error code to voltage_uv

regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv.

---
v2: check if ret is negative value

 drivers/iio/dac/ad5504.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5504.c +5 -1
index 242bdc7..1e9a1f4 100644
@@ -296,7 +296,11 @@ static int __devinit ad5504_probe(struct spi_device *spi)
 		if (ret)
 			goto error_put_reg;
 
-		voltage_uv = regulator_get_voltage(reg);
+		ret = regulator_get_voltage(reg);
+		if (ret < 0)
+			goto error_disable_reg;
+
+		voltage_uv = ret;
 	}
 
 	spi_set_drvdata(spi, indio_dev);
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v2 4/6 iio: dac: ad5624r_spi: Don't set error code to voltage_uv

regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv.

---
v2: check if ret is negative value

 drivers/iio/dac/ad5624r_spi.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5624r_spi.c +5 -1
index 6a7d6a4..ae7fb64 100644
@@ -238,7 +238,11 @@ static int __devinit ad5624r_probe(struct spi_device *spi)
 		if (ret)
 			goto error_put_reg;
 
-		voltage_uv = regulator_get_voltage(st->reg);
+		ret = regulator_get_voltage(st->reg);
+		if (ret < 0)
+			goto error_disable_reg;
+
+		voltage_uv = ret;
 	}
 
 	spi_set_drvdata(spi, indio_dev);
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH v2 5/6 iio: dac: ad5686: Don't set error code to voltage_uv

In reply to Axel Lin

regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv.

---
v2: check if ret is negative value

 drivers/iio/dac/ad5686.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5686.c +5 -1
index bc92ff9..28f2e59 100644
@@ -332,7 +332,11 @@ static int __devinit ad5686_probe(struct spi_device *spi)
 		if (ret)
 			goto error_put_reg;
 
-		voltage_uv = regulator_get_voltage(st->reg);
+		ret = regulator_get_voltage(st->reg);
+		if (ret < 0)
+			goto error_disable_reg;
+
+		voltage_uv = ret;
 	}
 
 	st->chip_info =
Signature · 1 line
1.7.9.5
maintainer
#3 lore raw
In reply to Axel Lin
Quoted 4 lines · Axel Lin

regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv.

Axel,

I would definitely have prefered a resend of the whole series rather than just the ones you have fixed up.

I assumed Lars would have no objection to Acking these as well!

Anyhow 1,2,6 from v1 and 3,4,5 from v2 added to fixes-togreg branch of iio.git.

Thanks for all these!

Jonathan

Quoted 23 lines

---
v2: check if ret is negative value

 drivers/iio/dac/ad5504.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5504.c +5 -1
index 242bdc7..1e9a1f4 100644
@@ -296,7 +296,11 @@ static int __devinit ad5504_probe(struct spi_device *spi)
 		if (ret)
 			goto error_put_reg;
 
-		voltage_uv = regulator_get_voltage(reg);
+		ret = regulator_get_voltage(reg);
+		if (ret < 0)
+			goto error_disable_reg;
+
+		voltage_uv = ret;
 	}
 
 	spi_set_drvdata(spi, indio_dev);