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

Jagan Teki jagan at openedev.com
Mon Oct 1 16:19:32 UTC 2018


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.

>   /*
>    * 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.


More information about the U-Boot mailing list