[i2c] [patch/rfc 2.6.21-rc3-git +i2c 0/4] remove some driver-model/i2c-core duplication
David Brownell
david-b at pacbell.net
Thu Mar 15 00:43:59 CET 2007
On Wednesday 14 March 2007 1:15 pm, Jean Delvare wrote:
>
> How is i2c_client.adapter different, BTW? We have to_i2c_adapter().
Modulo the way these things should all be inlined functions not macros,
my idea was to introduce
static inline struct i2c_adapter *i2c_adapter_of(struct i2c_client *c)
{
return to_i2c_adapter(c->dev.parent);
}
so code would use i2c_adapter_of(client) not client->adapter ... same
thing can be done for the 'driver' field, although that would get used
a lot less.
> > It's not much of an issue for the driver field though; drivers don't
> > need to access that after initialization, except when they hack some
> > diagnostic strings together ... or maybe invoke command().
>
> These cases are my main concern, but the truth is that they should not
> be there in the first place. We have dev_dbg() and friends for
> diagnostics,
For *some* diagnostics. The cases I saw were providing more info than
those dev_*() calls do, and I don't see anything wrong with that.
> and the whole command() thing is a nonsense with I already
> warned I wanted to kill. Which is why my plan is to convert these use
> cases to do The Right Thing (or rather, give people the time to do it),
> rather than a raw conversion which would let the current brokenness in
> place.
Different issue. Getting rid of command() doesn't need to hold
up removing the duplication. (And vice versa.)
> So instead of checking every time if i2c-isa will be a problem and how
> to deal with it, better kill i2c-isa now and go on with the cleanup
> patches after that. This will only increase my motivation to get all the
> i2c-isa drivers converted as soon as possible.
Sounds fine.
- Dave
More information about the i2c
mailing list