]> git.baikalelectronics.ru Git - kernel.git/commit
iio: core: Fix mapping of iio channels to entry numbers
authorGaurav Gupta <gauragup@cisco.com>
Tue, 27 Jun 2017 16:46:01 +0000 (09:46 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 15 Jul 2017 12:50:00 +0000 (13:50 +0100)
commit3fd173b333f62c8fa8253a3103de2fdb34552de9
tree4264fffdb5ebaea77e5c7bb11a1edd835450ac6d
parent463da0f905545393f1c9a9cc1389f6d53c404cde
iio: core: Fix mapping of iio channels to entry numbers

When adding maps to the list, they were added using list_add, which adds
them in LIFO order. When parsing using iio_channel_get_all(), these
elements are hence returned in reverse order. As a result, the iio_hwmon
mapping maps the first entry to the last channel and so on.

Signed-off-by: Gaurav Gupta <gauragup@cisco.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/inkern.c