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

Grant Likely grant.likely at secretlab.ca
Thu May 17 04:38:10 EST 2007


On 5/16/07, Jean Delvare <khali at linux-fr.org> wrote:
> 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?

Heh, oops.

I had replied to David saying that I would do this bit; but I forgot
to cc the list.

I'll take care of this.

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195



More information about the Linuxppc-dev mailing list