aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/ad5791.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/dac/ad5791.c')
-rw-r--r--drivers/iio/dac/ad5791.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/iio/dac/ad5791.c b/drivers/iio/dac/ad5791.c
index 2bd2e37280ff..6407b5407ddd 100644
--- a/drivers/iio/dac/ad5791.c
+++ b/drivers/iio/dac/ad5791.c
@@ -346,7 +346,7 @@ static const struct iio_info ad5791_info = {
346 .driver_module = THIS_MODULE, 346 .driver_module = THIS_MODULE,
347}; 347};
348 348
349static int __devinit ad5791_probe(struct spi_device *spi) 349static int ad5791_probe(struct spi_device *spi)
350{ 350{
351 struct ad5791_platform_data *pdata = spi->dev.platform_data; 351 struct ad5791_platform_data *pdata = spi->dev.platform_data;
352 struct iio_dev *indio_dev; 352 struct iio_dev *indio_dev;
@@ -365,7 +365,11 @@ static int __devinit ad5791_probe(struct spi_device *spi)
365 if (ret) 365 if (ret)
366 goto error_put_reg_pos; 366 goto error_put_reg_pos;
367 367
368 pos_voltage_uv = regulator_get_voltage(st->reg_vdd); 368 ret = regulator_get_voltage(st->reg_vdd);
369 if (ret < 0)
370 goto error_disable_reg_pos;
371
372 pos_voltage_uv = ret;
369 } 373 }
370 374
371 st->reg_vss = regulator_get(&spi->dev, "vss"); 375 st->reg_vss = regulator_get(&spi->dev, "vss");
@@ -374,7 +378,11 @@ static int __devinit ad5791_probe(struct spi_device *spi)
374 if (ret) 378 if (ret)
375 goto error_put_reg_neg; 379 goto error_put_reg_neg;
376 380
377 neg_voltage_uv = regulator_get_voltage(st->reg_vss); 381 ret = regulator_get_voltage(st->reg_vss);
382 if (ret < 0)
383 goto error_disable_reg_neg;
384
385 neg_voltage_uv = ret;
378 } 386 }
379 387
380 st->pwr_down = true; 388 st->pwr_down = true;
@@ -428,6 +436,7 @@ error_put_reg_neg:
428 if (!IS_ERR(st->reg_vss)) 436 if (!IS_ERR(st->reg_vss))
429 regulator_put(st->reg_vss); 437 regulator_put(st->reg_vss);
430 438
439error_disable_reg_pos:
431 if (!IS_ERR(st->reg_vdd)) 440 if (!IS_ERR(st->reg_vdd))
432 regulator_disable(st->reg_vdd); 441 regulator_disable(st->reg_vdd);
433error_put_reg_pos: 442error_put_reg_pos:
@@ -439,7 +448,7 @@ error_ret:
439 return ret; 448 return ret;
440} 449}
441 450
442static int __devexit ad5791_remove(struct spi_device *spi) 451static int ad5791_remove(struct spi_device *spi)
443{ 452{
444 struct iio_dev *indio_dev = spi_get_drvdata(spi); 453 struct iio_dev *indio_dev = spi_get_drvdata(spi);
445 struct ad5791_state *st = iio_priv(indio_dev); 454 struct ad5791_state *st = iio_priv(indio_dev);
@@ -475,7 +484,7 @@ static struct spi_driver ad5791_driver = {
475 .owner = THIS_MODULE, 484 .owner = THIS_MODULE,
476 }, 485 },
477 .probe = ad5791_probe, 486 .probe = ad5791_probe,
478 .remove = __devexit_p(ad5791_remove), 487 .remove = ad5791_remove,
479 .id_table = ad5791_id, 488 .id_table = ad5791_id,
480}; 489};
481module_spi_driver(ad5791_driver); 490module_spi_driver(ad5791_driver);