linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: greg@kroah.com
Cc: linux-iio@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 4/6] staging:iio:max1363 enable use with inkernel interfaces.
Date: Tue, 10 Apr 2012 21:11:07 +0100	[thread overview]
Message-ID: <1334088669-21032-5-git-send-email-jic23@kernel.org> (raw)
In-Reply-To: <1334088669-21032-1-git-send-email-jic23@kernel.org>

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
 drivers/staging/iio/adc/max1363_core.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index 2536b63..9d7db7f 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -36,6 +36,7 @@
 #include "../sysfs.h"
 #include "../events.h"
 #include "../buffer.h"
+#include "../driver.h"
 
 #include "max1363.h"
 
@@ -1290,6 +1291,9 @@ static int __devinit max1363_probe(struct i2c_client *client,
 		ret = -ENOMEM;
 		goto error_disable_reg;
 	}
+	ret = iio_map_array_register(indio_dev, client->dev.platform_data);
+	if (ret < 0)
+		goto error_free_device;
 	st = iio_priv(indio_dev);
 	st->reg = reg;
 	/* this is only used for device removal purposes */
@@ -1300,7 +1304,7 @@ static int __devinit max1363_probe(struct i2c_client *client,
 
 	ret = max1363_alloc_scan_masks(indio_dev);
 	if (ret)
-		goto error_free_device;
+		goto error_unregister_map;
 
 	/* Estabilish that the iio_dev is a child of the i2c device */
 	indio_dev->dev.parent = &client->dev;
@@ -1350,6 +1354,8 @@ error_cleanup_ring:
 	max1363_ring_cleanup(indio_dev);
 error_free_available_scan_masks:
 	kfree(indio_dev->available_scan_masks);
+error_unregister_map:
+	iio_map_array_unregister(indio_dev, client->dev.platform_data);
 error_free_device:
 	iio_free_device(indio_dev);
 error_disable_reg:
@@ -1376,6 +1382,7 @@ static int max1363_remove(struct i2c_client *client)
 		regulator_disable(reg);
 		regulator_put(reg);
 	}
+	iio_map_array_unregister(indio_dev, client->dev.platform_data);
 	iio_free_device(indio_dev);
 
 	return 0;
-- 
1.7.9.4


  parent reply	other threads:[~2012-04-10 20:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 20:11 [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Jonathan Cameron
2012-04-10 20:11 ` [PATCH 1/6] staging:iio:buffer example fix typos Jonathan Cameron
2012-04-10 20:11 ` [PATCH 2/6] staging:iio:adc:max1363 fix missing update_scan_mask callback Jonathan Cameron
2012-04-10 20:11 ` [PATCH 3/6] staging:iio fill in some missing docs Jonathan Cameron
2012-04-10 20:11 ` Jonathan Cameron [this message]
2012-04-10 20:11 ` [PATCH 5/6] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger Jonathan Cameron
2012-04-10 20:11 ` [PATCH 6/6] staging:iio: use spi->irq valid rather than querying available modes Jonathan Cameron
2012-04-10 20:27 ` [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Greg KH

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=1334088669-21032-5-git-send-email-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=greg@kroah.com \
    --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).