Thread (21 messages) 21 messages, 6 authors, 2024-08-26
STALE655d

[PATCH 2/9] mtd: add mtd_is_master helper

From: Marco Felsch <hidden>
Date: 2024-07-01 13:54:15
Also in: imx, linux-arm-kernel, linux-aspeed, linux-i2c, linux-mips, linux-omap, linux-renesas-soc, linux-tegra, lkml, loongarch
Subsystem: memory technology devices (mtd), the rest · Maintainers: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Linus Torvalds

Provide a simple helper to make it easy to detect an master mtd device.

Signed-off-by: Marco Felsch <redacted>
---
 include/linux/mtd/mtd.h | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 8d10d9d2e830..bf3fc2ea7230 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -408,6 +408,11 @@ static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd)
 	return mtd;
 }
 
+static inline bool mtd_is_master(struct mtd_info *mtd)
+{
+	return mtd->parent ? false : true;
+}
+
 static inline u64 mtd_get_master_ofs(struct mtd_info *mtd, u64 ofs)
 {
 	while (mtd->parent) {
-- 
2.39.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help