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

David Brownell david-b at pacbell.net
Wed Jan 3 20:53:18 CET 2007


On Wednesday 03 January 2007 5:26 am, Jean Delvare wrote:
>
> 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?

Just the design issue of synchronizing at that point, which tend to hide
bugs that can be triggered by the "cd drv_directory; rmmod driver" kind of
scenario I mentioned.  Normally one wants a release() to just free memory.

But changing that right now would clearly be intrusive, and in any case
would need to be preceded by removing a lot of duplication of driver core
functionality from the i2c core.  Which we've established can't all be done
very quickly (unfortunately).


> Right now we are initializing the completion right before releasing the
> device, rather than when creating the device as you're suggesting.

That's probably not an issue, although it's not an idiom to promote.


> 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?

The reason to prefer the "init at init time" idiom is not that it can't
be done "correctly" otherwise, but that it's more _obviously_ correct
that way ... as well as less redundant.  (There are multiple exit paths,
all of which "init" that state, but only one init path...)  As well as
being the traditional way to do things.

- Dave



More information about the i2c mailing list