summaryrefslogtreecommitdiffstats
path: root/drivers/iio/inkern.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-01-31 22:43:00 +0100
committerJonathan Cameron <jic23@kernel.org>2013-02-02 12:58:46 +0100
commitca7d98dbd7db6aa8bc4b08e26be1249436d21af3 (patch)
treeb0a094e0a28b62adace30b549a550305064a72d7 /drivers/iio/inkern.c
parentiio/adc: (max1363) Fix data conversion problems (diff)
downloadlinux-ca7d98dbd7db6aa8bc4b08e26be1249436d21af3.tar.xz
linux-ca7d98dbd7db6aa8bc4b08e26be1249436d21af3.zip
iio: Update iio_channel_get_all and iio_channel_get_all_cb API
Pass device pointer instead of device name as parameter to iio_channel_get_all and iio_channel_get_all_cb. This will enable us to use OF information to retrieve consumer channel information. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/inkern.c')
-rw-r--r--drivers/iio/inkern.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index d55e98fb300e..58d0ffe856b6 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -167,16 +167,18 @@ void iio_channel_release(struct iio_channel *channel)
}
EXPORT_SYMBOL_GPL(iio_channel_release);
-struct iio_channel *iio_channel_get_all(const char *name)
+struct iio_channel *iio_channel_get_all(struct device *dev)
{
+ const char *name;
struct iio_channel *chans;
struct iio_map_internal *c = NULL;
int nummaps = 0;
int mapind = 0;
int i, ret;
- if (name == NULL)
+ if (dev == NULL)
return ERR_PTR(-EINVAL);
+ name = dev_name(dev);
mutex_lock(&iio_map_list_lock);
/* first count the matching maps */