mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Ulrich Ölmann" <u.oelmann@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] of: partition: moan if adding a partition failed
Date: Fri,  6 Jan 2023 16:01:43 +0100	[thread overview]
Message-ID: <20230106150143.612182-1-u.oelmann@pengutronix.de> (raw)

Do not silently continue if e.g. the label of a partition defined in the
devicetree collides with the name of a partition defined in a GPT on the device.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
---
 drivers/of/partition.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/of/partition.c b/drivers/of/partition.c
index abbda674d6cb..b414985555b4 100644
--- a/drivers/of/partition.c
+++ b/drivers/of/partition.c
@@ -67,8 +67,10 @@ struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node)
 	filename = basprintf("%s.%s", cdev->name, partname);
 
 	new = devfs_add_partition(cdev->name, offset, size, flags, filename);
-	if (IS_ERR(new))
+	if (IS_ERR(new)) {
+		pr_err("Adding partition %s failed: %pe\n", filename, new);
 		new = NULL;
+	}
 
 	if (new)
 		new->device_node = node;;
-- 
2.30.2




             reply	other threads:[~2023-01-06 15:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 15:01 Ulrich Ölmann [this message]
2023-01-08 13:34 ` Alexander Shiyan
2023-01-09  6:15   ` Ulrich Ölmann

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=20230106150143.612182-1-u.oelmann@pengutronix.de \
    --to=u.oelmann@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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