From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] globalvar: propagate dev_set_param return value from globalvar_set
Date: Thu, 12 Mar 2026 15:43:15 +0100 [thread overview]
Message-ID: <20260312144325.2157379-1-a.fatoum@pengutronix.de> (raw)
dev_set_param() already returns an error code, which can be useful
for non-simple globalvars. Propagate it out of globalvar_set as well.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
common/globalvar.c | 4 ++--
include/globalvar.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/common/globalvar.c b/common/globalvar.c
index 876379b2538e..c2b0d5b4bbad 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -456,9 +456,9 @@ void globalvar_set_match(const char *match, const char *val)
}
}
-void globalvar_set(const char *name, const char *val)
+int globalvar_set(const char *name, const char *val)
{
- dev_set_param(&global_device, name, val);
+ return dev_set_param(&global_device, name, val);
}
static int globalvar_simple_set(struct bobject *bobj, struct param_d *p,
diff --git a/include/globalvar.h b/include/globalvar.h
index e369616c632a..413cf72002a0 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -22,7 +22,7 @@ int globalvar_add_simple(const char *name, const char *value);
void globalvar_remove(const char *name);
char *globalvar_get_match(const char *match, const char *separator);
void globalvar_set_match(const char *match, const char *val);
-void globalvar_set(const char *name, const char *val);
+int globalvar_set(const char *name, const char *val);
int globalvar_add_simple_string(const char *name, char **value);
int globalvar_add_simple_int(const char *name, int *value,
@@ -124,7 +124,7 @@ static inline char *globalvar_get_match(const char *match, const char *separator
static inline void globalvar_set_match(const char *match, const char *val) {}
-static inline void globalvar_set(const char *name, const char *val) {}
+static inline int globalvar_set(const char *name, const char *val) { return 0; }
static inline int nvvar_load(void)
{
--
2.47.3
next reply other threads:[~2026-03-12 14:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 14:43 Ahmad Fatoum [this message]
2026-03-12 14:43 ` [PATCH 2/2] globalvar: add helpers for stashing global variables Ahmad Fatoum
2026-03-18 8:12 ` Sascha Hauer
2026-03-18 9:22 ` Ahmad Fatoum
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=20260312144325.2157379-1-a.fatoum@pengutronix.de \
--to=a.fatoum@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