]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: mtd: print device OF path in listing
authorMarek Behún <marek.behun@nic.cz>
Wed, 26 May 2021 12:08:24 +0000 (14:08 +0200)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 24 Jun 2021 06:24:44 +0000 (11:54 +0530)
Print MTD's device OF path in the output of `mtd list` command.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Heiko Schocher <hs@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
cmd/mtd.c

index 485a963bdd0ffdcd7ac9db107994e275db1661e5..2aabfd4d2987cc36008023466256eec08763fde1 100644 (file)
--- a/cmd/mtd.c
+++ b/cmd/mtd.c
@@ -126,6 +126,13 @@ static void mtd_show_device(struct mtd_info *mtd)
                printf("  - driver: %s\n", mtd->dev->driver->name);
        }
 #endif
+       if (IS_ENABLED(CONFIG_OF_CONTROL) && mtd->dev) {
+               char buf[256];
+               int res;
+
+               res = ofnode_get_path(mtd_get_ofnode(mtd), buf, 256);
+               printf("  - path: %s\n", res == 0 ? buf : "unavailable");
+       }
 
        /* MTD device information */
        printf("  - type: ");