From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Mon, 1 Oct 2018 21:49:32 +0530 Subject: [U-Boot] [PATCH v13 5/7] cmd: mtd: add 'mtd' command In-Reply-To: <20181001134331.9756-6-miquel.raynal@bootlin.com> References: <20181001134331.9756-1-miquel.raynal@bootlin.com> <20181001134331.9756-6-miquel.raynal@bootlin.com> Message-ID: <16313623-bde3-7913-dcbc-5fe55d4485e7@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Acked-by: Jagan Teki > Reviewed-by: Stefan Roese > Reviewed-by: Boris Brezillon > --- [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 > > +struct udevice; > + > +#if defined(CONFIG_DM) it should be CONFIG_MTD. > /* > * 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); > +#else > +static inline struct mtd_info *mtd_get_info(struct udevice *dev) > +{ > + return NULL; > +} > + > +static inline int mtd_probe(struct udevice *dev) > +{ > + return 0; > +} there is not caller for this in non-dm, better this block empty is it? Let me know so-that I can do that and apply.