mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Trent Piepho <trent.piepho@igorinstitute.com>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] of: partitions: Skip fixup for devices with no partitions
Date: Tue, 12 Oct 2021 09:47:32 +0200	[thread overview]
Message-ID: <20211012074732.GL28453@pengutronix.de> (raw)
In-Reply-To: <20211011191933.857941-1-trent.piepho@igorinstitute.com>

On Mon, Oct 11, 2021 at 12:19:33PM -0700, Trent Piepho wrote:
> 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 <trent.piepho@igorinstitute.com>
> ---
>  drivers/of/partition.c | 3 +++
>  1 file changed, 3 insertions(+)

Applied, thanks

Sascha

> 
> 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);
>  	free(name);
> -- 
> 2.31.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2021-10-12  7:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 19:19 Trent Piepho
2021-10-12  7:47 ` Sascha Hauer [this message]

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=20211012074732.GL28453@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=trent.piepho@igorinstitute.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