[i2c] i2c-remove-redundant-i2c_client-list.patch

David Brownell david-b at pacbell.net
Fri Jan 18 11:30:24 CET 2008


On Friday 18 January 2008, Jean Delvare wrote:
> >  static int i2c_check_addr(struct i2c_adapter *adapter, int addr)
> >  {
> > -     int rval;
> > -
> > -     mutex_lock(&adapter->clist_lock);
> > -     rval = __i2c_check_addr(adapter, addr);
> > -     mutex_unlock(&adapter->clist_lock);
> > -
> > -     return rval;
> > +     return device_for_each_child(&adapter->dev, &addr, __i2c_check_addr);
> >  }
> >  
> >  int i2c_attach_client(struct i2c_client *client)
> 
> With this patch applied, any reason why i2c_new_probed_device() still
> acquires adapter->clist_lock? My understanding is that it was there
> because i2c_check_addr() was originally walking the internal client
> list, but as this is no longer the case, the locking is no longer
> needed, is it?

Doesn't look needed now, no.  It previously called __i2c_check_addr(),
which needed that lock; could have used the non-underscore version
all along.

- Dave




More information about the i2c mailing list