On 07/01/2017 10:40 AM, Jonathan Cameron wrote:
On Tue, 27 Jun 2017 09:46:01 -0700
Gaurav Gupta <gauragup@xxxxxxxxx> wrote:
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@xxxxxxxxx>
Gah. This is one of those nasty cases where I clearly messed up a
long time ago, but unfortunately it's become user space ABI.
So looking for general opinions on whether we can fix this one
or not. I can't immediately think of a clean way to tidy this up.
So do we think people will notice if we fix this?
I would just go for it.
Guenter
Jonathan
---
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:
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html