[U-Boot] [PATCH v13 5/7] cmd: mtd: add 'mtd' command

Miquel Raynal miquel.raynal at bootlin.com
Mon Oct 1 20:39:19 UTC 2018


Hi Jagan,

Jagan Teki <jagan at openedev.com> wrote on Mon, 1 Oct 2018 21:49:32 +0530:

> On Monday 01 October 2018 07:13 PM, Miquel Raynal wrote:
> > There should not be a 'nand' command, a 'sf' command and certainly not
> > a new 'spi-nand' command. Write a 'mtd' command instead to manage all
> > MTD devices/partitions at once. This should be the preferred way to
> > access any MTD device.  
> > > Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>  
> > Acked-by: Jagan Teki <jagan at openedev.com>
> > Reviewed-by: Stefan Roese <sr at denx.de>
> > Reviewed-by: Boris Brezillon <boris.brezillon at bootlin.com>
> > ---  
> 
> [snip]
> 
> >   >   static int get_part(const char *partname, int *idx, loff_t *off, loff_t *size,  
> > diff --git a/include/mtd.h b/include/mtd.h
> > index 6e6da3002f..011f26b3e1 100644
> > --- a/include/mtd.h
> > +++ b/include/mtd.h
> > @@ -8,6 +8,9 @@  
> >   >   #include <linux/mtd/mtd.h>
> >   > +struct udevice;  
> > +
> > +#if defined(CONFIG_DM)  
> 
> it should be CONFIG_MTD.

Same, I don't mind.

> 
> >   /*
> >    * Get mtd_info structure of the dev, which is stored as uclass private.
> >    *
> > @@ -20,5 +23,18 @@ static inline struct mtd_info *mtd_get_info(struct udevice *dev)
> >   }  
> >   >   int mtd_probe(struct udevice *dev);  
>  [...]  
> 
> there is not caller for this in non-dm, better this block empty is it?

So I can't remove mtd_get_info() which has no callers at all but you
want to remove the dummy helper which is not used when DM is not
enabled? I have no problem with that, but the logic is not very
coherent.

> 
> Let me know so-that I can do that and apply.

Yes please, you can amend this patch and apply it.

BTW, the build is successful with all configurations
-> https://travis-ci.org/miquelraynal/u-boot/builds/435575048


Thanks,
Miquèl


More information about the U-Boot mailing list