From: Marek BehĂșn Date: Wed, 26 May 2021 12:08:24 +0000 (+0200) Subject: cmd: mtd: print device OF path in listing X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=0b6f907d1543f1670460a797d62f49231b92ca98;p=u-boot.git 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 Reviewed-by: Miquel Raynal Tested-by: Patrice Chotard Reviewed-by: Jagan Teki Cc: Priyanka Jain Cc: Simon Glass Cc: Heiko Schocher Cc: Patrick Delaunay --- diff --git a/cmd/mtd.c b/cmd/mtd.c index 485a963bdd..2aabfd4d29 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: ");