From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: Shubhrajyoti Datta
<omaplinuxkernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Subject: Re: [PATCH] i2c: (i2c-diolan-u2c) Fix master_xfer return code
Date: Mon, 13 Aug 2012 09:05:34 -0700 [thread overview]
Message-ID: <20120813160534.GA13359@roeck-us.net> (raw)
In-Reply-To: <CAM=Q2ctzBg+o-3On8-i-T49Dg9H=_2Tv7Z9iZba6iErTQoLVXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Mon, Aug 13, 2012 at 11:57:15AM +0530, Shubhrajyoti Datta wrote:
> On Fri, Aug 10, 2012 at 10:36 PM, Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> wrote:
> [...]
> >>
> >> However if only a few go through should we return the number of
> >> successful transactions
> >> instead of error?
> >>
> > Most other I2C bus drivers do the same, so I decided to not make the code
> > more complicated than necessary and do it the same way. Also, I prefer to have
> > the actual error code returned to the caller, not "I transferred x of your y
> > messages, but I won't tell you what went wrong with the rest".
>
> depends on what the user decides however if ever his algo is that resend only
> the remaining it would never work. Anyways thats a different story.
>
Worse, many callers don't check if the return code matches the number of
messages. So errors can get lost if the return code after an error is not
negative.
Guenter
> >
> > If that prevents it from getting integrated, I'll be happy to change it.
>
> I have no objections to the patch getting integrated.
> Afterall anything that helps, helps:-)
>
>
> >
> > Thanks,
> > Guenter
>
next prev parent reply other threads:[~2012-08-13 16:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-09 15:47 [PATCH] i2c: (i2c-diolan-u2c) Fix master_xfer return code Guenter Roeck
[not found] ` <1344527240-18266-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2012-08-10 5:58 ` Shubhrajyoti Datta
[not found] ` <CAM=Q2ctnrO6hJkPDa_daDRFNyig3+GVDkgW_MGMjV24jEM8T5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-10 17:06 ` Guenter Roeck
[not found] ` <20120810170624.GC29281-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2012-08-13 6:27 ` Shubhrajyoti Datta
[not found] ` <CAM=Q2ctzBg+o-3On8-i-T49Dg9H=_2Tv7Z9iZba6iErTQoLVXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-13 16:05 ` Guenter Roeck [this message]
2012-08-18 10:27 ` 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=20120813160534.GA13359@roeck-us.net \
--to=linux-0h96xk9xttrk1umjsbkqmq@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=omaplinuxkernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@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;
as well as URLs for NNTP newsgroup(s).