lkml.org 
[lkml]   [2014]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Resend Patch 7/9] I2C/ACPI: Add i2c ACPI operation region support
On Wed, Apr 23, 2014 at 09:53:21AM +0800, Lan Tianyu wrote:
> Hi Mika:
> Thanks a lot for your review.
>
> On 2014年04月22日 19:36, Mika Westerberg wrote:
> >> > +
> >> > + client.adapter = adapter;
> >> > + client.addr = sb->slave_address;
> >> > + client.flags = 0;
> > I'm not sure if this is the correct way to use struct i2c_client
> > (allocating it from stack and passing forward to functions that might
> > expect a real i2c_client structure). It has ->dev and all.
>
> I check all i2c_smbus_xxx helper functions and they are simple wrappers
> of i2c_smbus_xfer(). Only adapter, addr and flags of struct client are
> used in these functions.

In that case I suppose it is OK to (ab)use the client structure like this.

I think you still want to initialize the whole structure (unused fields
with zero) before passing it to the wrappers.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-04-23 09:41    [W:0.070 / U:1.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site