From: Jonathan Cameron <jic23@kernel.org>
To: Gaurav Gupta <gauragup@cisco.com>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
linux-iio@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH] iio: core: Fix mapping of iio channels to entry numbers
Date: Sat, 1 Jul 2017 18:40:28 +0100 [thread overview]
Message-ID: <20170701184028.0a2f9511@kernel.org> (raw)
In-Reply-To: <20170627164601.GA30866@sjc-ads-988.cisco.com>
On Tue, 27 Jun 2017 09:46:01 -0700
Gaurav Gupta <gauragup@cisco.com> 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@cisco.com>
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?
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:
next prev parent reply other threads:[~2017-07-01 17:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2017-07-01 18:46 ` Guenter Roeck
2017-07-14 16:51 ` Gaurav Gupta (gauragup)
2017-07-15 12:51 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170701184028.0a2f9511@kernel.org \
--to=jic23@kernel.org \
--cc=gauragup@cisco.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=pmeerw@pmeerw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).