linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: greg@kroah.com, guenter.roeck@ericsson.com, khali@linux-fr.org,
	dmitry.torokhov@gmail.com, broonie@opensource.wolfsonmicro.com,
	alan@lxorguk.ukuu.org.uk, arnd@arndb.de,
	linus.walleij@linaro.org, maxime.ripard@free-electrons.com,
	thomas.petazzoni@free-electrons.com, zdevai@gmail.com,
	w.sang@pengutronix.de, marek.vasut@gmail.com,
	Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 5.5/6] staging:iio:max1363 enable use with inkernel interfaces.
Date: Wed, 15 Feb 2012 21:11:59 +0000	[thread overview]
Message-ID: <1329340319-3569-1-git-send-email-jic23@kernel.org> (raw)
In-Reply-To: <1329335285-31006-1-git-send-email-jic23@kernel.org>

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
Oops patch 6 doesn't make much sense without this driver support.

 drivers/staging/iio/adc/max1363_core.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index 3a5bd20..29ab0aa 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"
 
@@ -1268,6 +1269,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 */
@@ -1281,7 +1285,7 @@ static int __devinit max1363_probe(struct i2c_client *client,
 			  (st->chip_info->num_modes + 1), GFP_KERNEL);
 	if (!indio_dev->available_scan_masks) {
 		ret = -ENOMEM;
-		goto error_free_device;
+		goto error_unregister_map;
 	}
 
 	for (i = 0; i < st->chip_info->num_modes; i++)
@@ -1337,6 +1341,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:
@@ -1363,6 +1369,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.8.4

  parent reply	other threads:[~2012-02-15 21:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15 19:47 [PATCH 0/6 V6] IIO: in kernel (as opposed to userspace) pull consumers Jonathan Cameron
2012-02-15 19:48 ` [PATCH 1/6] staging:iio:core set the iio_dev.info pointer to null on unregister under lock Jonathan Cameron
2012-02-15 19:48 ` [PATCH 2/6] staging:iio:core add in kernel interface mapping and getting IIO channels Jonathan Cameron
2012-02-15 19:48 ` [PATCH 3/6] staging:iio: move iio data return types into types.h for use by inkern Jonathan Cameron
2012-02-15 19:48 ` [PATCH 4/6] staging:iio::hwmon interface client driver Jonathan Cameron
2012-02-15 19:48 ` [PATCH 5/6] staging:iio:Documentation in kernel pull description Jonathan Cameron
2012-02-15 19:48 ` [PATCH 6/6] stargate2: example of map configuration for iio to hwmon example Jonathan Cameron
2012-02-15 21:07   ` Jonathan Cameron
2012-02-24 20:07     ` Greg KH
2012-02-25 11:19       ` Jonathan Cameron
2012-02-15 21:11 ` Jonathan Cameron [this message]
2012-02-15 21:50 ` [PATCH 0/6 V6] IIO: in kernel (as opposed to userspace) pull consumers Linus Walleij
2012-02-24 20:10   ` 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=1329340319-3569-1-git-send-email-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=greg@kroah.com \
    --cc=guenter.roeck@ericsson.com \
    --cc=khali@linux-fr.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=w.sang@pengutronix.de \
    --cc=zdevai@gmail.com \
    /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).