lkml.org 
[lkml]   [2015]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V1 1/1] iio: Added Capella cm3232 ambient light sensor driver.
From
Date
On Mon, 2015-01-05 at 16:20 +0200, Daniel Baluta wrote:
> On Mon, Jan 5, 2015 at 3:09 PM, Joe Perches <joe@perches.com> wrote:
> > On Mon, 2015-01-05 at 12:51 +0200, Daniel Baluta wrote:
> >> On Thu, Jan 1, 2015 at 2:10 AM, Kevin Tsai <ktsai@capellamicro.com> wrote:
> >> > CM3232 is an advanced ambient light sensor with I2C protocol interface.
> >> > The I2C slave address is internally hardwired as 0x10 (7-bit). Writing
> >> > to configure register is byte mode, but reading ALS register requests to
> >> > use word mode for 16-bit resolution.
[]
> >> You could directly return i2c_smbus_write_byte_data(..).
> >
> > Sometimes it's better to return a specific value
> > for the error instead of depending on correctness
> > of all the indirect functions in the call chain.
> >
> > In this case, all the smbus_xfer functions must
> > return 0 on success. Do they?
>
> Yes.
>
> http://lxr.free-electrons.com/source/drivers/i2c/i2c-core.c#L2845

This doesn't show that adapter->algo->smbus_xfer()
returns 0, you have to look at the code for that
indirectly called function.

> Also, I guess kbuild test robot will complain about it, like here:
>
> http://marc.info/?l=linux-kernel&m=141963536230419&w=2

Is the kbuild test robot now submitting patches for all
possible coccinelle simplifications? I don't think so.




\
 
 \ /
  Last update: 2015-01-05 18:01    [W:0.175 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site