aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/ad5624r_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/dac/ad5624r_spi.c')
-rw-r--r--drivers/iio/dac/ad5624r_spi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/iio/dac/ad5624r_spi.c b/drivers/iio/dac/ad5624r_spi.c
index 6a7d6a48cc6d..f6e116627b71 100644
--- a/drivers/iio/dac/ad5624r_spi.c
+++ b/drivers/iio/dac/ad5624r_spi.c
@@ -220,7 +220,7 @@ static const struct ad5624r_chip_info ad5624r_chip_info_tbl[] = {
220 }, 220 },
221}; 221};
222 222
223static int __devinit ad5624r_probe(struct spi_device *spi) 223static int ad5624r_probe(struct spi_device *spi)
224{ 224{
225 struct ad5624r_state *st; 225 struct ad5624r_state *st;
226 struct iio_dev *indio_dev; 226 struct iio_dev *indio_dev;
@@ -238,7 +238,11 @@ static int __devinit ad5624r_probe(struct spi_device *spi)
238 if (ret) 238 if (ret)
239 goto error_put_reg; 239 goto error_put_reg;
240 240
241 voltage_uv = regulator_get_voltage(st->reg); 241 ret = regulator_get_voltage(st->reg);
242 if (ret < 0)
243 goto error_disable_reg;
244
245 voltage_uv = ret;
242 } 246 }
243 247
244 spi_set_drvdata(spi, indio_dev); 248 spi_set_drvdata(spi, indio_dev);
@@ -282,7 +286,7 @@ error_ret:
282 return ret; 286 return ret;
283} 287}
284 288
285static int __devexit ad5624r_remove(struct spi_device *spi) 289static int ad5624r_remove(struct spi_device *spi)
286{ 290{
287 struct iio_dev *indio_dev = spi_get_drvdata(spi); 291 struct iio_dev *indio_dev = spi_get_drvdata(spi);
288 struct ad5624r_state *st = iio_priv(indio_dev); 292 struct ad5624r_state *st = iio_priv(indio_dev);
@@ -314,7 +318,7 @@ static struct spi_driver ad5624r_driver = {
314 .owner = THIS_MODULE, 318 .owner = THIS_MODULE,
315 }, 319 },
316 .probe = ad5624r_probe, 320 .probe = ad5624r_probe,
317 .remove = __devexit_p(ad5624r_remove), 321 .remove = ad5624r_remove,
318 .id_table = ad5624r_id, 322 .id_table = ad5624r_id,
319}; 323};
320module_spi_driver(ad5624r_driver); 324module_spi_driver(ad5624r_driver);