From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Jonathan Cameron <jic23@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH] iio: dac: Convert ad5380 to devm_regmap_* APIs
Date: Fri, 15 Jun 2012 16:40:21 +0800 [thread overview]
Message-ID: <1339749621.7253.1.camel@phoenix> (raw)
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/iio/dac/ad5380.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c
index 5dfb445..14991ac 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,
if (indio_dev == NULL) {
dev_err(dev, "Failed to allocate iio device\n");
ret = -ENOMEM;
- goto error_regmap_exit;
+ goto error_out;
}
st = iio_priv(indio_dev);
@@ -436,8 +436,7 @@ error_free_reg:
kfree(indio_dev->channels);
error_free:
iio_device_free(indio_dev);
-error_regmap_exit:
- regmap_exit(regmap);
+error_out:
return ret;
}
@@ -456,7 +455,6 @@ static int __devexit ad5380_remove(struct device *dev)
regulator_put(st->vref_reg);
}
- regmap_exit(st->regmap);
iio_device_free(indio_dev);
return 0;
@@ -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);
struct regmap *regmap;
- regmap = regmap_init_spi(spi, &ad5380_regmap_config);
+ regmap = devm_regmap_init_spi(spi, &ad5380_regmap_config);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
@@ -559,7 +557,7 @@ static int __devinit ad5380_i2c_probe(struct i2c_client *i2c,
{
struct regmap *regmap;
- regmap = regmap_init_i2c(i2c, &ad5380_regmap_config);
+ regmap = devm_regmap_init_i2c(i2c, &ad5380_regmap_config);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
--
1.7.9.5
next reply other threads:[~2012-06-15 8:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 8:40 Axel Lin [this message]
2012-06-15 8:47 ` [PATCH] iio: dac: Convert ad5380 to devm_regmap_* APIs Lars-Peter Clausen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339749621.7253.1.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.