aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/inkern.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-02-04 15:26:00 -0500
committerJonathan Cameron <jic23@kernel.org>2013-02-06 14:23:52 -0500
commit5aa57f0a655276f62683c0cc714cd6328d98e08a (patch)
treedf06afdc9f598c3da0671a296d2319191e46be2b /drivers/iio/inkern.c
parent860c9c54272deaab43b40dbe416becb34abd344f (diff)
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/inkern.c')
-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 c42aba6817e8..b289915b8469 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -93,7 +93,8 @@ static const struct iio_chan_spec
93} 93}
94 94
95 95
96struct iio_channel *iio_channel_get(const char *name, const char *channel_name) 96static struct iio_channel *iio_channel_get_sys(const char *name,
97 const char *channel_name)
97{ 98{
98 struct iio_map_internal *c_i = NULL, *c = NULL; 99 struct iio_map_internal *c_i = NULL, *c = NULL;
99 struct iio_channel *channel; 100 struct iio_channel *channel;
@@ -144,6 +145,14 @@ error_no_mem:
144 iio_device_put(c->indio_dev); 145 iio_device_put(c->indio_dev);
145 return ERR_PTR(err); 146 return ERR_PTR(err);
146} 147}
148
149struct iio_channel *iio_channel_get(struct device *dev,
150 const char *channel_name)
151{
152 const char *name = dev ? dev_name(dev) : NULL;
153
154 return iio_channel_get_sys(name, channel_name);
155}
147EXPORT_SYMBOL_GPL(iio_channel_get); 156EXPORT_SYMBOL_GPL(iio_channel_get);
148 157
149void iio_channel_release(struct iio_channel *channel) 158void iio_channel_release(struct iio_channel *channel)