All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <marek.behun@nic.cz>
To: u-boot@lists.denx.de
Cc: "Tom Rini" <trini@konsulko.com>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Priyanka Jain" <priyanka.jain@nxp.com>,
	"Simon Glass" <sjg@chromium.org>, "Heiko Schocher" <hs@denx.de>,
	"Patrick Delaunay" <patrick.delaunay@st.com>,
	"Patrice CHOTARD" <patrice.chotard@foss.st.com>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Marek Behún" <marek.behun@nic.cz>
Subject: [PATCH u-boot-dm + u-boot-spi v4 08/10] cmd: mtd: print device OF path in listing
Date: Wed, 26 May 2021 14:08:24 +0200	[thread overview]
Message-ID: <20210526120826.8045-9-marek.behun@nic.cz> (raw)
In-Reply-To: <20210526120826.8045-1-marek.behun@nic.cz>

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>
Cc: 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: Jagan Teki <jagan@amarulasolutions.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
---
 cmd/mtd.c | 7 +++++++
 1 file changed, 7 insertions(+)

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: ");
-- 
2.26.3


  parent reply	other threads:[~2021-05-26 12:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 12:08 [PATCH u-boot-dm + u-boot-spi v4 00/10] Support SPI NORs and OF partitions in `mtd list` Marek Behún
2021-05-26 12:08 ` [PATCH u-boot-dm + u-boot-spi v4 01/10] dm: core: add non-translating version of ofnode_get_addr_size_index() Marek Behún
2021-05-26 12:08 ` [PATCH u-boot-dm + u-boot-spi v4 02/10] dm: core: add ofnode_get_path() Marek Behún
2021-05-26 12:08 ` [PATCH u-boot-dm + u-boot-spi v4 03/10] mtd: add support for parsing partitions defined in OF Marek Behún
2021-05-26 12:08 ` [PATCH u-boot-dm + u-boot-spi v4 04/10] mtd: spi-nor: allow registering multiple MTDs when DM is enabled Marek Behún
2021-07-07 23:54   ` Masami Hiramatsu
2021-07-08 14:15     ` Marek Behún
2021-07-08 14:56       ` Tom Rini
2021-07-09  0:19       ` Masami Hiramatsu
2021-05-26 12:08 ` [PATCH u-boot-dm + u-boot-spi v4 05/10] mtd: spi-nor: fill-in mtd->dev member Marek Behún
2021-05-26 12:08 ` [PATCH u-boot-dm + u-boot-spi v4 06/10] mtd: remove mtd_probe() function Marek Behún
2021-05-26 12:08 ` [PATCH u-boot-dm + u-boot-spi v4 07/10] mtd: probe SPI NOR devices in mtd_probe_devices() Marek Behún
2021-05-26 12:08 ` Marek Behún [this message]
2021-05-26 12:08 ` [PATCH u-boot-dm + u-boot-spi v4 09/10] mtd: compare also with OF path and device name in get_mtd_device_nm() Marek Behún
2021-05-26 12:08 ` [PATCH u-boot-dm + u-boot-spi v4 10/10] cmd: mtd: expand <name> argument definition in command help Marek Behún
2021-05-26 16:58 ` [PATCH u-boot-dm + u-boot-spi v4 00/10] Support SPI NORs and OF partitions in `mtd list` Jagan Teki
2021-05-26 17:54   ` Marek Behún
2021-05-26 18:04     ` Jagan Teki
2021-06-02 14:03       ` Marek Behún
2021-06-24 11:36 ` Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210526120826.8045-9-marek.behun@nic.cz \
    --to=marek.behun@nic.cz \
    --cc=hs@denx.de \
    --cc=jagan@amarulasolutions.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@st.com \
    --cc=priyanka.jain@nxp.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.