From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [PATCH] i2c: (i2c-diolan-u2c) Fix master_xfer return code Date: Mon, 13 Aug 2012 09:05:34 -0700 Message-ID: <20120813160534.GA13359@roeck-us.net> References: <1344527240-18266-1-git-send-email-linux@roeck-us.net> <20120810170624.GC29281@roeck-us.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Shubhrajyoti Datta Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ben Dooks , Jean Delvare , Wolfram Sang List-Id: linux-i2c@vger.kernel.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 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 >