linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: core: Fix mapping of iio channels to entry numbers
@ 2017-06-27 16:46 Gaurav Gupta
  2017-07-01 17:40 ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Gaurav Gupta @ 2017-06-27 16:46 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw, linux-iio

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>
---
 drivers/iio/inkern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index 7a13535..9b0715c 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -44,7 +44,7 @@ int iio_map_array_register(struct iio_dev *indio_dev, struct iio_map *maps)
 		}
 		mapi->map = &maps[i];
 		mapi->indio_dev = indio_dev;
-		list_add(&mapi->l, &iio_map_list);
+		list_add_tail(&mapi->l, &iio_map_list);
 		i++;
 	}
 error_ret:
-- 
2.10.2.dirty

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-15 12:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-27 16:46 [PATCH] iio: core: Fix mapping of iio channels to entry numbers Gaurav Gupta
2017-07-01 17:40 ` Jonathan Cameron
2017-07-01 18:46   ` Guenter Roeck
2017-07-14 16:51     ` Gaurav Gupta (gauragup)
2017-07-15 12:51       ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).