From: Dmitry Osipenko <digetx@gmail.com>
To: "Wang, Jiada" <jiada_wang@mentor.com>,
nick@shmanahar.org, dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
erosca@de.adit-jv.com, Andrew_Gabbasov@mentor.com
Subject: Re: [PATCH 1/1] Input: atmel_mxt_ts - implement I2C retries
Date: Thu, 3 Sep 2020 18:06:14 +0300 [thread overview]
Message-ID: <8a287e4b-6ed4-dfae-fedb-da343ee40126@gmail.com> (raw)
In-Reply-To: <2c8ed5c8-f95b-dce4-f964-ac16f12c3f20@mentor.com>
03.09.2020 17:44, Wang, Jiada пишет:
> Hi Dmitry
>
...
>> Is it really possible to get a positive ret != 2 from i2c_transfer()?
>>
>> Maybe it's better to keep the old code behaviour by returning the "ret"
>> value directly if it's not equal to ARRAY_SIZE(xfer)?
>>
> I think, theoretically i2c_transfer() may return positive value but !=
> number to transfer,
> original behavior is,
> when ret >= 0, it returns -EIO, when ret < 0, it just returns ret,
>
> current behavior is, when ret != 2, it returns -EIO, after retry.
>
> I am OK to change the behavior exactly as same original one.
The comment to i2c_transfer() says that it either returns a error code
or number of executed messages. But it's not clear to me what I2C driver
could return 0 or 1 here and why.
I think it indeed should be better to keep the original behaviour by
propagating the actual error code whenever possible. It's probably not
critical for this particular case, but in general it's always better to
preserve the original error code.
prev parent reply other threads:[~2020-09-03 15:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 8:22 [PATCH 1/1] Input: atmel_mxt_ts - implement I2C retries Jiada Wang
2020-08-28 8:19 ` Dmitry Osipenko
2020-09-03 14:44 ` Wang, Jiada
2020-09-03 15:06 ` Dmitry Osipenko [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=8a287e4b-6ed4-dfae-fedb-da343ee40126@gmail.com \
--to=digetx@gmail.com \
--cc=Andrew_Gabbasov@mentor.com \
--cc=dmitry.torokhov@gmail.com \
--cc=erosca@de.adit-jv.com \
--cc=jiada_wang@mentor.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick@shmanahar.org \
/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).