From: Jonathan Cameron <jic23@kernel.org>
To: Song Qiang <songqiang1304521@gmail.com>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
shubhrajyoti@ti.com, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: magnetometer: hmc5843: Replace a return value.
Date: Sat, 22 Sep 2018 10:28:11 +0100 [thread overview]
Message-ID: <20180922102811.7ad29532@archlinux> (raw)
In-Reply-To: <20180920134219.8402-1-songqiang1304521@gmail.com>
On Thu, 20 Sep 2018 21:42:19 +0800
Song Qiang <songqiang1304521@gmail.com> wrote:
> This error apparently is caused by timed out event, so a -ETIMEDOUT
> should be used instead of a -EIO, and it also tells user what happened
> , so this dev_err may not be needed anymore.
>
> Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
> ---
> I used ./scripts/get_maintainer.pl to get maintainers about this file,
> I thought this script searches maintainers with looking up MAINTAINER,
> is that right?
> So I searched MAINTAINER and also found nothing related to hmc5843.
> In the declearation area I can see Shubhrajyoti Datta
> <shubhrajyoti@ti.com> wroted this driver and several other people
> including Peter Meerwald have contributed. Is this driver now a orphan?
> Or if it is, I think we may also need to add it to the MAINTAINER file.
> I'm also familiar with this device, I think I can add interrupt support
> later.
Those drivers not covered by more explicit MAINTAINER entries are
picked up by the main IIO one. Of course if you are working in a
significant way with the driver and want to adopt it, then post
a patch adding a MAINTAINERS entry and see if any of the previous
significant contributors mind (or potentially want to co-maintain it).
>
> drivers/iio/magnetometer/hmc5843_core.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/magnetometer/hmc5843_core.c b/drivers/iio/magnetometer/hmc5843_core.c
> index ada142fb7aa3..4fb393c3854c 100644
> --- a/drivers/iio/magnetometer/hmc5843_core.c
> +++ b/drivers/iio/magnetometer/hmc5843_core.c
> @@ -170,8 +170,7 @@ static int hmc5843_wait_measurement(struct hmc5843_data *data)
> }
>
> if (tries < 0) {
> - dev_err(data->dev, "data not ready\n");
> - return -EIO;
> + return -ETIMEDOUT;
I'd say no on this one as I suspect such a timeout only indicates a
communication problem, not some delay in the hardware managing to
return an answer..
It's certainly not a clear enough reason to my mind to argue for changing
the error code (which it is just possible some less than ideal userspace
code is relying on).
Jonathan
> }
>
> return 0;
prev parent reply other threads:[~2018-09-22 15:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-20 13:42 [PATCH] iio: magnetometer: hmc5843: Replace a return value Song Qiang
2018-09-22 9:28 ` Jonathan Cameron [this message]
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=20180922102811.7ad29532@archlinux \
--to=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=shubhrajyoti@ti.com \
--cc=songqiang1304521@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.