From: Stefano Manni <stefano.manni@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: Re: [PATCH] cdev: fix mtd partition handling
Date: Tue, 05 Aug 2025 15:14:56 +0200 [thread overview]
Message-ID: <WGVI0T.84MQHXOHEEW01@gmail.com> (raw)
In-Reply-To: <20250805072537.3484221-1-s.hauer@pengutronix.de>
On mar, ago 5 2025 at 09:25:37 +02:00:00, Sascha Hauer
<s.hauer@pengutronix.de> wrote:
> 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
>
Tested-by: Stefano Manni <stefano.manni@gmail.com>
next prev parent reply other threads:[~2025-08-05 11:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 7:25 [PATCH] cdev: fix mtd partition handling Sascha Hauer
2025-08-05 13:14 ` Stefano Manni [this message]
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=WGVI0T.84MQHXOHEEW01@gmail.com \
--to=stefano.manni@gmail.com \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.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.