From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Yegor Yefremov <yegor_sub1-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org
Subject: Re: [PATCH] fix i2c_pca_pf_waitforcompletion() return value
Date: Tue, 21 Sep 2010 07:41:50 +0200 [thread overview]
Message-ID: <20100921054150.GA29281@pengutronix.de> (raw)
In-Reply-To: <4C9725F8.1080200-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]
On Mon, Sep 20, 2010 at 11:14:32AM +0200, Yegor Yefremov wrote:
> ret is still -1, if during the polling read_byte() returns at once
> with I2C_PCA_CON_SI set. So ret > 0 would lead
> i2c_pca_pf_waitforcompletion() to return 0, in spite of
> the proper behavior. That's why only ret should be returned.
>
> Signed-off-by: Yegor Yefremov <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
Thanks for reporting. In deed, this needs to be corrected. However, I think we
should clean up the code some more and get rid of the initialization of ret
altogether (and hopefully make it more readable with this). Do you have time
for this, otherwise I'll have a look later.
Regards,
Wolfram
>
> Index: b/drivers/i2c/busses/i2c-pca-platform.c
> ===================================================================
> --- a/drivers/i2c/busses/i2c-pca-platform.c 2010-08-27 01:47:12.000000000 +0200
> +++ b/drivers/i2c/busses/i2c-pca-platform.c 2010-09-20 10:21:05.000000000 +0200
> @@ -96,7 +96,7 @@
> udelay(100);
> }
>
> - return ret > 0;
> + return ret;
> }
>
> static void i2c_pca_pf_dummyreset(void *pd)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2010-09-21 5:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-20 9:14 [PATCH] fix i2c_pca_pf_waitforcompletion() return value Yegor Yefremov
[not found] ` <4C9725F8.1080200-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
2010-09-21 5:41 ` Wolfram Sang [this message]
[not found] ` <20100921054150.GA29281-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-09-21 13:59 ` Yegor Yefremov
[not found] ` <4C98BA51.3000209-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
2010-09-22 8:55 ` Yegor Yefremov
[not found] ` <4C99C479.7040902-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>
2010-09-22 9:04 ` Wolfram Sang
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=20100921054150.GA29281@pengutronix.de \
--to=w.sang-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=yegor_sub1-ZJVcf1zZPRSebONBosFW4Q@public.gmane.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