From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
Stefano Manni <stefano.manni@gmail.com>
Subject: [PATCH] cdev: fix mtd partition handling
Date: Tue, 5 Aug 2025 09:25:37 +0200 [thread overview]
Message-ID: <20250805072537.3484221-1-s.hauer@pengutronix.de> (raw)
devfs-core.c implements the partition handling only for devices that are
not MTD devices. MTD devices have their own partition handling in
drivers/mtd/partition.c, see the special case in __devfs_add_partition()
for MTD devices. This means for MTD devices we have to pass the original
cdev to the ops, not the master cdev.
Fixes: 6d2b6f399c07 ("cdev: pass master cdev to cdev ops")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
fs/devfs-core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/devfs-core.c b/fs/devfs-core.c
index 52490576b7..9c2dae5545 100644
--- a/fs/devfs-core.c
+++ b/fs/devfs-core.c
@@ -226,6 +226,10 @@ int cdev_find_free_index(const char *basename)
static struct cdev *cdev_get_master(struct cdev *cdev)
{
+ /* mtd devices handle partitions themselves */
+ if (cdev->mtd)
+ return cdev;
+
while (cdev && cdev_is_partition(cdev))
cdev = cdev->master;
--
2.39.5
next reply other threads:[~2025-08-05 7:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 7:25 Sascha Hauer [this message]
2025-08-05 13:14 ` Stefano Manni
2025-08-06 4:56 ` Sascha Hauer
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=20250805072537.3484221-1-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=stefano.manni@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox