From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Ajay Gupta <ajayg@nvidia.com>
Cc: "wsa@the-dreams.de" <wsa@the-dreams.de>,
"peda@axentia.se" <peda@axentia.se>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [v13,2/2] usb: typec: ucsi: add support for Cypress CCGx
Date: Fri, 26 Oct 2018 10:27:54 +0300 [thread overview]
Message-ID: <20181026072754.GA30531@kuha.fi.intel.com> (raw)
On Thu, Oct 25, 2018 at 09:55:47PM +0000, Ajay Gupta wrote:
> Hi Heikki and Andy
> [...]
> > > > Shouldn't you return -ETIMEDOUT if count == 0?
> > > Yes. Good catch. Does the below fix looks ok?
> > >
> > > do {
> > > status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, sizeof(data));
> > > if (status < 0)
> > > return status;
> > >
> > > usleep_range(10000, 11000);
> > >
> > > status = ccg_read(uc, CCGX_RAB_INTR_REG, &data, sizeof(data));
> > > if (status < 0)
> > > return status;
> > >
> > > if (!data)
> > > return 0;
> > > } while (data && count--);
> >
> > Doesn't that condition break out of the loop immediately?
> How? I didn't get your point? We want to break out when data is
> zero (interrupt status cleared).
Sorry Ajay. My brain interpreted that "while" as an "if" statement :-)
thanks,
next reply other threads:[~2018-10-26 7:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-26 7:27 Heikki Krogerus [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-10-26 16:25 [v13,2/2] usb: typec: ucsi: add support for Cypress CCGx Ajay Gupta
2018-10-26 6:49 Peter Rosin
2018-10-25 21:55 Ajay Gupta
2018-10-25 21:30 Ajay Gupta
2018-10-25 21:29 Ajay Gupta
2018-10-25 9:26 Andy Shevchenko
2018-10-25 9:26 Heikki Krogerus
2018-10-25 9:07 Peter Rosin
2018-10-25 8:17 Heikki Krogerus
2018-10-24 17:43 Ajay Gupta
2018-10-24 9:25 Andy Shevchenko
2018-10-23 18:56 Ajay Gupta
2018-10-23 9:35 Heikki Krogerus
2018-10-03 18:27 Ajay Gupta
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=20181026072754.GA30531@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=ajayg@nvidia.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peda@axentia.se \
--cc=wsa@the-dreams.de \
/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).