summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-03-04 19:59:05 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-03-05 16:28:05 +0100
commit3401bb2165854b7e625d8919cab42ce12ffe4990 (patch)
treeb6691c08591c21d0258c1855e85255ed3f5ed086
parent2481ff8ac2df5a2872999ba7ade964d1e2c16e86 (diff)
downloadbarebox-3401bb216585.tar.gz
barebox-3401bb216585.tar.xz
commands: stat: print DT node for cdevs if available
It may not be directly apparent, what device a cdev spawned from. Have stat report this information for debugging purposes. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-21-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--fs/fs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 1e357872f6..a7097dd394 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -69,6 +69,7 @@ EXPORT_SYMBOL(mkmodestr);
void cdev_print(const struct cdev *cdev)
{
+ struct device_node *np;
int nbytes;
if (cdev->dev || cdev->master || cdev->partname) {
@@ -118,6 +119,10 @@ void cdev_print(const struct cdev *cdev)
if (nbytes)
printf("\n");
+
+ np = cdev_of_node(cdev);
+ if (np)
+ printf("DT node: %pOF\n", np);
}
EXPORT_SYMBOL(cdev_print);