summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-02-04 20:26:00 +0000
committerJonathan Cameron <jic23@kernel.org>2013-02-06 19:23:52 +0000
commit5aa57f0a655276f62683c0cc714cd6328d98e08a (patch)
treedf06afdc9f598c3da0671a296d2319191e46be2b /drivers/iio
parent860c9c54272deaab43b40dbe416becb34abd344f (diff)
downloadop-kernel-dev-5aa57f0a655276f62683c0cc714cd6328d98e08a.zip
op-kernel-dev-5aa57f0a655276f62683c0cc714cd6328d98e08a.tar.gz
iio: Update iio_channel_get API to use consumer device pointer as argument
For iio_channel_get to work with OF based configurations, it needs the consumer device pointer instead of the consumer device name as argument. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Anton Vorontsov <anton@enomsg.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/inkern.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index c42aba6..b289915b 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -93,7 +93,8 @@ static const struct iio_chan_spec
}
-struct iio_channel *iio_channel_get(const char *name, const char *channel_name)
+static struct iio_channel *iio_channel_get_sys(const char *name,
+ const char *channel_name)
{
struct iio_map_internal *c_i = NULL, *c = NULL;
struct iio_channel *channel;
@@ -144,6 +145,14 @@ error_no_mem:
iio_device_put(c->indio_dev);
return ERR_PTR(err);
}
+
+struct iio_channel *iio_channel_get(struct device *dev,
+ const char *channel_name)
+{
+ const char *name = dev ? dev_name(dev) : NULL;
+
+ return iio_channel_get_sys(name, channel_name);
+}
EXPORT_SYMBOL_GPL(iio_channel_get);
void iio_channel_release(struct iio_channel *channel)
OpenPOWER on IntegriCloud