Commit d03fcfe6 authored by Axel Lin's avatar Axel Lin Committed by Greg Kroah-Hartman

iio: dac: Convert ad5380 to devm_regmap_* APIs

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4d9505af
...@@ -373,7 +373,7 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap, ...@@ -373,7 +373,7 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap,
if (indio_dev == NULL) { if (indio_dev == NULL) {
dev_err(dev, "Failed to allocate iio device\n"); dev_err(dev, "Failed to allocate iio device\n");
ret = -ENOMEM; ret = -ENOMEM;
goto error_regmap_exit; goto error_out;
} }
st = iio_priv(indio_dev); st = iio_priv(indio_dev);
...@@ -436,8 +436,7 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap, ...@@ -436,8 +436,7 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap,
kfree(indio_dev->channels); kfree(indio_dev->channels);
error_free: error_free:
iio_device_free(indio_dev); iio_device_free(indio_dev);
error_regmap_exit: error_out:
regmap_exit(regmap);
return ret; return ret;
} }
...@@ -456,7 +455,6 @@ static int __devexit ad5380_remove(struct device *dev) ...@@ -456,7 +455,6 @@ static int __devexit ad5380_remove(struct device *dev)
regulator_put(st->vref_reg); regulator_put(st->vref_reg);
} }
regmap_exit(st->regmap);
iio_device_free(indio_dev); iio_device_free(indio_dev);
return 0; return 0;
...@@ -485,7 +483,7 @@ static int __devinit ad5380_spi_probe(struct spi_device *spi) ...@@ -485,7 +483,7 @@ static int __devinit ad5380_spi_probe(struct spi_device *spi)
const struct spi_device_id *id = spi_get_device_id(spi); const struct spi_device_id *id = spi_get_device_id(spi);
struct regmap *regmap; struct regmap *regmap;
regmap = regmap_init_spi(spi, &ad5380_regmap_config); regmap = devm_regmap_init_spi(spi, &ad5380_regmap_config);
if (IS_ERR(regmap)) if (IS_ERR(regmap))
return PTR_ERR(regmap); return PTR_ERR(regmap);
...@@ -559,7 +557,7 @@ static int __devinit ad5380_i2c_probe(struct i2c_client *i2c, ...@@ -559,7 +557,7 @@ static int __devinit ad5380_i2c_probe(struct i2c_client *i2c,
{ {
struct regmap *regmap; struct regmap *regmap;
regmap = regmap_init_i2c(i2c, &ad5380_regmap_config); regmap = devm_regmap_init_i2c(i2c, &ad5380_regmap_config);
if (IS_ERR(regmap)) if (IS_ERR(regmap))
return PTR_ERR(regmap); return PTR_ERR(regmap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment