[i2c] [patch 2.6.20-rc1 5/6] remove i2c_adapter.dev from i2c core and adapters

Jean Delvare khali at linux-fr.org
Wed Jan 3 14:26:37 CET 2007


David,

On Thu, 28 Dec 2006 21:09:25 -0800, David Brownell wrote:
> > OK, I understand the idea. What I'm not sure about is when exactly we
> > are supposed to call init_completion() and wait_for_completion(), and
> > what these functions do. 
> 
> Call init_completion() when the data structure is initialized.  In this
> case, wait_for_completion() gets called when something wants to wait
> till the memory gets freed.  (The need for which reflects design issues.)
> 
> 
> > Likewise, I don't know when the .release 
> > callback will be called. I assume that wait_for_completion(x) blocks
> > until someone (presumably the driver core) calls complete(x)?
> 
> The release() callback is called when the last refcount on a device
> goes away; for hotpluggable devices that'd usually be when the device
> is physically unplugged, but sometimes a reference lingers later.  And
> sysfs is a good source of lingering references.

OK, thanks for the explanation. Now just to make it clear, is there any
bug with regards to completions in the curent i2c-core/i2c-isa code?
Right now we are initializing the completion right before releasing the
device, rather than when creating the device as you're suggesting.
Given that the completion is only accessed when releasing the device, I
don't think it makes any difference, it sounds more like a personnal
implementation preference. Or am I missing something?

Thanks,
-- 
Jean Delvare



More information about the i2c mailing list