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

David Brownell david-b at pacbell.net
Wed May 16 02:05:20 EST 2007


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.

- Dave



More information about the Linuxppc-dev mailing list