linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sachin Kamat <sachin.kamat@linaro.org>
To: linux-iio@vger.kernel.org
Cc: jic23@kernel.org, lars@metafoo.de, sachin.kamat@linaro.org
Subject: [PATCH 3/8] iio: adc: mcp320x: Use devm_iio_device_register
Date: Tue, 24 Sep 2013 17:35:33 +0530	[thread overview]
Message-ID: <1380024338-30204-4-git-send-email-sachin.kamat@linaro.org> (raw)
In-Reply-To: <1380024338-30204-1-git-send-email-sachin.kamat@linaro.org>

devm_iio_device_register simplifies the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/iio/adc/mcp320x.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/adc/mcp320x.c b/drivers/iio/adc/mcp320x.c
index 28a086e..5333558 100644
--- a/drivers/iio/adc/mcp320x.c
+++ b/drivers/iio/adc/mcp320x.c
@@ -203,7 +203,7 @@ static int mcp320x_probe(struct spi_device *spi)
 
 	mutex_init(&adc->lock);
 
-	ret = iio_device_register(indio_dev);
+	ret = devm_iio_device_register(&spi->dev, indio_dev);
 	if (ret < 0)
 		goto reg_disable;
 
@@ -220,7 +220,6 @@ static int mcp320x_remove(struct spi_device *spi)
 	struct iio_dev *indio_dev = spi_get_drvdata(spi);
 	struct mcp320x *adc = iio_priv(indio_dev);
 
-	iio_device_unregister(indio_dev);
 	regulator_disable(adc->reg);
 
 	return 0;
-- 
1.7.9.5

  parent reply	other threads:[~2013-09-24 12:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 12:05 [PATCH 0/8] iio: Introduce devm_iio_device_{register,unregister} Sachin Kamat
2013-09-24 12:05 ` [PATCH 1/8] iio: core: Implement devm_iio_device_{register,unregister} Sachin Kamat
2013-09-24 12:05 ` [PATCH 2/8] iio: accel: kxsd9: Use devm_iio_device_register Sachin Kamat
2013-09-24 12:05 ` Sachin Kamat [this message]
2013-09-24 12:05 ` [PATCH 4/8] iio: adc: mcp3422: " Sachin Kamat
2013-09-24 12:05 ` [PATCH 5/8] iio: adc: ti-adc081c: " Sachin Kamat
2013-09-24 12:05 ` [PATCH 6/8] iio: adc: twl6030-gpadc: " Sachin Kamat
2013-09-24 12:05 ` [PATCH 7/8] iio: adc: viperboard: " Sachin Kamat
2013-09-24 12:05 ` [PATCH 8/8] iio: amplifiers: ad8366: " Sachin Kamat
2013-09-24 13:08   ` Jonathan Cameron
2013-09-24 13:13 ` [PATCH 0/8] iio: Introduce devm_iio_device_{register,unregister} Jonathan Cameron
2013-09-24 14:52   ` Sachin Kamat

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=1380024338-30204-4-git-send-email-sachin.kamat@linaro.org \
    --to=sachin.kamat@linaro.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).