aboutsummaryrefslogtreecommitdiff
path: root/cmd/mtd.c
diff options
context:
space:
mode:
authorMarek BehĂșn2021-05-26 14:08:24 +0200
committerJagan Teki2021-06-24 11:54:44 +0530
commit0b6f907d1543f1670460a797d62f49231b92ca98 (patch)
tree514061b735e12bf549b3e752860ca2c05a365308 /cmd/mtd.c
parent3c58c79b5ff1fb75780be18b86d1ae64b19c2136 (diff)
cmd: mtd: print device OF path in listing
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>
Diffstat (limited to 'cmd/mtd.c')
-rw-r--r--cmd/mtd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/mtd.c b/cmd/mtd.c
index 485a963bdd0..2aabfd4d298 100644
--- 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: ");