[i2c] i2c-remove-redundant-i2c_client-list.patch
Jean Delvare
khali at linux-fr.org
Fri Jan 18 13:10:05 CET 2008
Hi David,
On Fri, 18 Jan 2008 02:16:22 -0800, David Brownell wrote:
> On Friday 18 January 2008, Jean Delvare wrote:
> > This gave me the idea of a similar cleanup in i2c_detach_client: I fail
> > to see why we hold the clist lock while unregistering the device. What
> > do you think of the following cleanup?
>
> Looks OK. Similarly, i2c_new_probed_device() could
> use a driver model iterator instead of clist_lock.
I'm not sure I follow you here. i2c_new_probed_device() doesn't really
walk the list of clients, all it does is calling i2c_check_addr(), as
was discussed elsewhere in this thread. This left apart, I don't see
what kind of "driver model iterator" you would want to use in this
function.
> Something else to think about: clist_lock isn't used
> when iterating over i2c_adapter.clients. Maybe it should
> just be removed, and replaced *everywhere* by core_lists...
I don't really want to do that. The redundant client list will be
dropped at some point in time, and it's easier to validate such changes
with dedicated locks. Having a single lock for many things makes it
quite hard to figure out what was being protected after the fact.
--
Jean Delvare
More information about the i2c
mailing list