[i2c] [PATCH] Make i2c-mpc driver use i2c_add_numbered_adapter

Jean Delvare khali at linux-fr.org
Thu May 17 04:25:20 EST 2007


On Tue, 15 May 2007 09:05:20 -0700, David Brownell wrote:
> On Tuesday 15 May 2007, Grant Likely wrote:
> > 
> > Take another look; this is a funny quirk of the driver.  The
> > assignment is 'i2c->adap = mpc_ops'; not 'i2c->adap = &mpc_ops'.  And
> > in struct mpc_i2c, the field is declared as 'struct i2c_adapter adap',
> > not 'struct i2c_adapter *adap'.  The driver instance gets a copy of
> > the mpc_ops structure to initialize it, not a pointer to the staticly
> > defined structure.  I got bitten by the same thing when I was looking
> > at the code.
> 
> I see -- you're right.  That "template" idiom is a good one to get
> rid of, FWIW ... not only is it confusing, but it also wastes space.

Well, maybe you can submit a patch fixing this one?

-- 
Jean Delvare



More information about the Linuxppc-dev mailing list