diff options
Diffstat (limited to 'drivers/iio/dac/ad5504.c')
-rw-r--r-- | drivers/iio/dac/ad5504.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c index 242bdc7d0044..0661829f2773 100644 --- a/drivers/iio/dac/ad5504.c +++ b/drivers/iio/dac/ad5504.c @@ -277,7 +277,7 @@ static const struct iio_chan_spec ad5504_channels[] = { AD5504_CHANNEL(3), }; -static int __devinit ad5504_probe(struct spi_device *spi) +static int ad5504_probe(struct spi_device *spi) { struct ad5504_platform_data *pdata = spi->dev.platform_data; struct iio_dev *indio_dev; @@ -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); @@ -352,7 +356,7 @@ error_ret: return ret; } -static int __devexit ad5504_remove(struct spi_device *spi) +static int ad5504_remove(struct spi_device *spi) { struct iio_dev *indio_dev = spi_get_drvdata(spi); struct ad5504_state *st = iio_priv(indio_dev); @@ -383,7 +387,7 @@ static struct spi_driver ad5504_driver = { .owner = THIS_MODULE, }, .probe = ad5504_probe, - .remove = __devexit_p(ad5504_remove), + .remove = ad5504_remove, .id_table = ad5504_id, }; module_spi_driver(ad5504_driver); |