diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-03-04 19:59:05 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-03-05 16:28:05 +0100 |
commit | 3401bb2165854b7e625d8919cab42ce12ffe4990 (patch) | |
tree | b6691c08591c21d0258c1855e85255ed3f5ed086 | |
parent | 2481ff8ac2df5a2872999ba7ade964d1e2c16e86 (diff) | |
download | barebox-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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |