On Wednesday 10 December 2008, Felipe Balbi wrote:
> On Tue, Dec 09, 2008 at 05:29:49PM -0800, David Brownell wrote:
> > On Tuesday 09 December 2008, Felipe Balbi wrote:
> > > +struct davinci_nand_info {
> > > +       /* device lock */
> > > +       spinlock_t              lock;
> > > +       struct nand_chip        chip;
> > > +       struct mtd_info         mtd;
> > >  
> > > -/*
> > > - * MTD structure for DaVinici board
> > > - */
> > > -static struct mtd_info *nand_davinci_mtd;
> > > +       struct device           *dev;
> > > +       struct clk              *clk;
> > > +
> > > +       void __iomem            *base;
> > > +       void __iomem            *vaddr;
> > > +};
> > > +
> > > +#define to_davinci_nand(m) container_of(m, struct davinci_nand_info, mtd)
> > 
> > Minor nit:  put "mtd" first and this becomes a NOP by the
> > time code generation completes, so code is a bit smaller
> > and register pressure is a bit less.

> 
> didn't quite get it. You mean:
> 
> #define to_davinci_nand(mtd) container_of(mtd, struct davinci_nand_info, mtd)
> 
> or something else ?!?

I mean "struct davinci_nand_info { struct mtd_info mtd; ... };"

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to