Thread (9 messages) flat view 9 messages, 4 authors, 2007-05-16

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

From: David Brownell <hidden>
Date: 2007-05-15 16:05:25

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help