mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] of: partitions: Skip fixup for devices with no partitions
@ 2021-10-11 19:19 Trent Piepho
  2021-10-12  7:47 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Trent Piepho @ 2021-10-11 19:19 UTC (permalink / raw)
  To: Barebox List; +Cc: Trent Piepho

If the device has no partitions, e.g. most EEPROM or OTP memory,
of_partition_fixup() can exit early, before trying to find the kernel dt
node and calling of_fixup_partitions().

This avoids spurious error messages when the kernel dt node doesn't
exist.  E.g., for an EEPROM in the Barebox dtb but not in the kernel
dtb, Barebox will display an error about being unable to fixup the
kernel dt node, however, if it had found the node it would just return
without doing anything since the partition list is empty, so really
there is no error.

Signed-off-by: Trent Piepho <>
 drivers/of/partition.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/of/partition.c b/drivers/of/partition.c
index 10081363d..18b138f00 100644
--- a/drivers/of/partition.c
+++ b/drivers/of/partition.c
@@ -256,6 +256,9 @@ static int of_partition_fixup(struct device_node *root, void *ctx)
 	if (!cdev->device_node)
 		return -EINVAL;
+	if (list_empty(&cdev->partitions))
+		return 0;
 	name = of_get_reproducible_name(cdev->device_node);
 	np = of_find_node_by_reproducible_name(root, name);

barebox mailing list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-12  7:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 19:19 [PATCH] of: partitions: Skip fixup for devices with no partitions Trent Piepho
2021-10-12  7:47 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox