diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-06-15 04:40:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-15 17:36:25 -0400 |
commit | d03fcfe626b89832b36dbfa5fb32a805478b097a (patch) | |
tree | 2fef8b42627bd4bdcfcdef30570c2212385124b0 /drivers/iio/dac | |
parent | 4d9505af7743828464d066795c6e1311c7884db4 (diff) |
iio: dac: Convert ad5380 to devm_regmap_* APIs
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/dac')
-rw-r--r-- | drivers/iio/dac/ad5380.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c index 5dfb4451728f..14991ac55f26 100644 --- a/drivers/iio/dac/ad5380.c +++ b/drivers/iio/dac/ad5380.c | |||
@@ -373,7 +373,7 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap, | |||
373 | if (indio_dev == NULL) { | 373 | if (indio_dev == NULL) { |
374 | dev_err(dev, "Failed to allocate iio device\n"); | 374 | dev_err(dev, "Failed to allocate iio device\n"); |
375 | ret = -ENOMEM; | 375 | ret = -ENOMEM; |
376 | goto error_regmap_exit; | 376 | goto error_out; |
377 | } | 377 | } |
378 | 378 | ||
379 | st = iio_priv(indio_dev); | 379 | st = iio_priv(indio_dev); |
@@ -436,8 +436,7 @@ error_free_reg: | |||
436 | kfree(indio_dev->channels); | 436 | kfree(indio_dev->channels); |
437 | error_free: | 437 | error_free: |
438 | iio_device_free(indio_dev); | 438 | iio_device_free(indio_dev); |
439 | error_regmap_exit: | 439 | error_out: |
440 | regmap_exit(regmap); | ||
441 | 440 | ||
442 | return ret; | 441 | return ret; |
443 | } | 442 | } |
@@ -456,7 +455,6 @@ static int __devexit ad5380_remove(struct device *dev) | |||
456 | regulator_put(st->vref_reg); | 455 | regulator_put(st->vref_reg); |
457 | } | 456 | } |
458 | 457 | ||
459 | regmap_exit(st->regmap); | ||
460 | iio_device_free(indio_dev); | 458 | iio_device_free(indio_dev); |
461 | 459 | ||
462 | return 0; | 460 | return 0; |
@@ -485,7 +483,7 @@ static int __devinit ad5380_spi_probe(struct spi_device *spi) | |||
485 | const struct spi_device_id *id = spi_get_device_id(spi); | 483 | const struct spi_device_id *id = spi_get_device_id(spi); |
486 | struct regmap *regmap; | 484 | struct regmap *regmap; |
487 | 485 | ||
488 | regmap = regmap_init_spi(spi, &ad5380_regmap_config); | 486 | regmap = devm_regmap_init_spi(spi, &ad5380_regmap_config); |
489 | 487 | ||
490 | if (IS_ERR(regmap)) | 488 | if (IS_ERR(regmap)) |
491 | return PTR_ERR(regmap); | 489 | return PTR_ERR(regmap); |
@@ -559,7 +557,7 @@ static int __devinit ad5380_i2c_probe(struct i2c_client *i2c, | |||
559 | { | 557 | { |
560 | struct regmap *regmap; | 558 | struct regmap *regmap; |
561 | 559 | ||
562 | regmap = regmap_init_i2c(i2c, &ad5380_regmap_config); | 560 | regmap = devm_regmap_init_i2c(i2c, &ad5380_regmap_config); |
563 | 561 | ||
564 | if (IS_ERR(regmap)) | 562 | if (IS_ERR(regmap)) |
565 | return PTR_ERR(regmap); | 563 | return PTR_ERR(regmap); |