From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Subject: [PATCH 3/3] blspec: take extra entries into account
Date: Wed, 20 Sep 2023 14:37:20 +0200 [thread overview]
Message-ID: <20230920123720.767063-3-r.czerwinski@pengutronix.de> (raw)
In-Reply-To: <20230920123720.767063-1-r.czerwinski@pengutronix.de>
Wire up the possible extra entries during entry matching.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
common/blspec.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/common/blspec.c b/common/blspec.c
index e361a02333..e950de4e99 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -512,7 +512,9 @@ int blspec_scan_file(struct bootentries *bootentries, const char *root,
const char *configname)
{
char *devname = NULL, *hwdevname = NULL;
+ struct blspec_extra_entry *extra;
struct blspec_entry *entry;
+ bool found;
if (blspec_have_entry(bootentries, configname))
return -EEXIST;
@@ -526,7 +528,16 @@ int blspec_scan_file(struct bootentries *bootentries, const char *root,
entry->configpath = xstrdup(configname);
entry->cdev = get_cdev_by_mountpath(root);
- if (!entry_is_of_compatible(entry, of_get_machine_compatible())) {
+ found = entry_is_of_compatible(entry, of_get_machine_compatible());
+ if (!found && blspec_extra_list) {
+ list_for_each_entry(extra, blspec_extra_list, list) {
+ found = entry_is_of_compatible(entry, extra->compatible);
+ if (found)
+ break;
+ }
+ }
+
+ if (!found) {
blspec_entry_free(&entry->entry);
return -ENODEV;
}
--
2.42.0
next prev parent reply other threads:[~2023-09-20 12:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 12:37 [PATCH 1/3] blspec: take compatible name as argument Rouven Czerwinski
2023-09-20 12:37 ` [PATCH 2/3] blspec: add new blspec.compatible.extra variable Rouven Czerwinski
2023-09-21 12:37 ` Ahmad Fatoum
2023-09-22 5:19 ` Ahmad Fatoum
2023-09-21 12:57 ` Sascha Hauer
2023-09-20 12:37 ` Rouven Czerwinski [this message]
2023-09-21 12:33 ` [PATCH 1/3] blspec: take compatible name as argument Ahmad Fatoum
2023-09-21 12:38 ` 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=20230920123720.767063-3-r.czerwinski@pengutronix.de \
--to=r.czerwinski@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