lkml.org 
[lkml]   [2015]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] i2c: allow building emev2 without slave mode again

> > > The slave_cb callback function is supposed to set the 'value'
> > > here,
> >
> > Only if a master wants to READ from us.
>
> Right, and can this never fail?

Exactly. The slave can stretch the clock if the value to be sent to the
master needs some processing first, but it must deliver something.

> With my current code to turn i2c_slave_event() into an empty inline function
> in case of !CONFIG_I2C_SLAVE, the compiler knows that "value" is uninitialized
> at the point where we write it to the register, and warns about it.

I overlooked that your first patch changed this code, sorry. Now I see
the problem.

What about not ifdeffing the inline function and keep the build error
whenever someone uses it without I2C_SLAVE being selected?

Thanks,

Wolfram

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2015-12-13 10:21    [W:0.155 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site