diff options
author | Guenter Roeck <linux@roeck-us.net> | 2013-02-01 01:43:00 +0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-02-02 15:58:46 +0400 |
commit | ca7d98dbd7db6aa8bc4b08e26be1249436d21af3 (patch) | |
tree | b0a094e0a28b62adace30b549a550305064a72d7 /drivers/staging/iio | |
parent | 482bb4e6c648a68598cde9d4a56b066df26d5ae6 (diff) | |
download | linux-ca7d98dbd7db6aa8bc4b08e26be1249436d21af3.tar.xz |
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/staging/iio')
-rw-r--r-- | drivers/staging/iio/iio_hwmon.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/iio/iio_hwmon.c b/drivers/staging/iio/iio_hwmon.c index d4ef34fe0341..93af756ba48c 100644 --- a/drivers/staging/iio/iio_hwmon.c +++ b/drivers/staging/iio/iio_hwmon.c @@ -71,14 +71,17 @@ static int iio_hwmon_probe(struct platform_device *pdev) int ret, i; int in_i = 1, temp_i = 1, curr_i = 1; enum iio_chan_type type; + struct iio_channel *channels; + + channels = iio_channel_get_all(dev); + if (IS_ERR(channels)) + return PTR_ERR(channels); st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL); if (st == NULL) return -ENOMEM; - st->channels = iio_channel_get_all(dev_name(dev)); - if (IS_ERR(st->channels)) - return PTR_ERR(st->channels); + st->channels = channels; /* count how many attributes we have */ while (st->channels[st->num_channels].indio_dev) |