aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/ad5686.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/dac/ad5686.c')
-rw-r--r--drivers/iio/dac/ad5686.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
index bc92ff9309c2..ca9609d7a15c 100644
--- a/drivers/iio/dac/ad5686.c
+++ b/drivers/iio/dac/ad5686.c
@@ -313,7 +313,7 @@ static const struct ad5686_chip_info ad5686_chip_info_tbl[] = {
313}; 313};
314 314
315 315
316static int __devinit ad5686_probe(struct spi_device *spi) 316static int ad5686_probe(struct spi_device *spi)
317{ 317{
318 struct ad5686_state *st; 318 struct ad5686_state *st;
319 struct iio_dev *indio_dev; 319 struct iio_dev *indio_dev;
@@ -332,7 +332,11 @@ static int __devinit ad5686_probe(struct spi_device *spi)
332 if (ret) 332 if (ret)
333 goto error_put_reg; 333 goto error_put_reg;
334 334
335 voltage_uv = regulator_get_voltage(st->reg); 335 ret = regulator_get_voltage(st->reg);
336 if (ret < 0)
337 goto error_disable_reg;
338
339 voltage_uv = ret;
336 } 340 }
337 341
338 st->chip_info = 342 st->chip_info =
@@ -379,7 +383,7 @@ error_put_reg:
379 return ret; 383 return ret;
380} 384}
381 385
382static int __devexit ad5686_remove(struct spi_device *spi) 386static int ad5686_remove(struct spi_device *spi)
383{ 387{
384 struct iio_dev *indio_dev = spi_get_drvdata(spi); 388 struct iio_dev *indio_dev = spi_get_drvdata(spi);
385 struct ad5686_state *st = iio_priv(indio_dev); 389 struct ad5686_state *st = iio_priv(indio_dev);
@@ -408,7 +412,7 @@ static struct spi_driver ad5686_driver = {
408 .owner = THIS_MODULE, 412 .owner = THIS_MODULE,
409 }, 413 },
410 .probe = ad5686_probe, 414 .probe = ad5686_probe,
411 .remove = __devexit_p(ad5686_remove), 415 .remove = ad5686_remove,
412 .id_table = ad5686_id, 416 .id_table = ad5686_id,
413}; 417};
414module_spi_driver(ad5686_driver); 418module_spi_driver(ad5686_driver);