From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 2/7] reset_source: fix ordering of exported functions
Date: Sun, 25 Aug 2019 17:58:39 +0200 [thread overview]
Message-ID: <20190825155844.18455-3-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20190825155844.18455-1-u.kleine-koenig@pengutronix.de>
Declare and implement getters first, then setters. This syncs the order
of functions in reset_source.c and reset_source.h.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
common/reset_source.c | 12 ++++++------
include/reset_source.h | 33 +++++++++++++++++++--------------
2 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/common/reset_source.c b/common/reset_source.c
index e24aa337a7c4..f400112483a5 100644
--- a/common/reset_source.c
+++ b/common/reset_source.c
@@ -41,6 +41,12 @@ enum reset_src_type reset_source_get(void)
}
EXPORT_SYMBOL(reset_source_get);
+const char *reset_source_name(void)
+{
+ return reset_src_names[reset_source];
+}
+EXPORT_SYMBOL(reset_source_name);
+
int reset_source_get_instance(void)
{
return reset_source_instance;
@@ -61,12 +67,6 @@ void reset_source_set_priority(enum reset_src_type st, unsigned int priority)
}
EXPORT_SYMBOL(reset_source_set_priority);
-const char *reset_source_name(void)
-{
- return reset_src_names[reset_source];
-}
-EXPORT_SYMBOL(reset_source_name);
-
void reset_source_set_instance(enum reset_src_type type, int instance)
{
if (reset_source == type)
diff --git a/include/reset_source.h b/include/reset_source.h
index 2848a91115b8..85329c8cea7a 100644
--- a/include/reset_source.h
+++ b/include/reset_source.h
@@ -26,25 +26,26 @@ enum reset_src_type {
};
#ifdef CONFIG_RESET_SOURCE
-void reset_source_set_priority(enum reset_src_type, unsigned int priority);
+
enum reset_src_type reset_source_get(void);
-void reset_source_set_instance(enum reset_src_type type, int instance);
+const char *reset_source_name(void);
int reset_source_get_instance(void);
+
+void reset_source_set_priority(enum reset_src_type, unsigned int priority);
+void reset_source_set_instance(enum reset_src_type type, int instance);
+
unsigned int of_get_reset_source_priority(struct device_node *node);
-const char *reset_source_name(void);
+
#else
-static inline void reset_source_set_priority(enum reset_src_type type,
- unsigned int priority)
-{
-}
-static inline void reset_source_set_instance(enum reset_src_type type, int instance)
+static inline enum reset_src_type reset_source_get(void)
{
+ return RESET_UKWN;
}
-static inline enum reset_src_type reset_source_get(void)
+static inline const char *reset_source_name(void)
{
- return RESET_UKWN;
+ return "unknown";
}
static inline int reset_source_get_instance(void)
@@ -52,14 +53,18 @@ static inline int reset_source_get_instance(void)
return -1;
}
-static inline unsigned int of_get_reset_source_priority(struct device_node *node)
+static inline void reset_source_set_priority(enum reset_src_type type,
+ unsigned int priority)
{
- return 0;
}
-static inline const char *reset_source_name(void)
+static inline void reset_source_set_instance(enum reset_src_type type, int instance)
{
- return "unknown";
+}
+
+static inline unsigned int of_get_reset_source_priority(struct device_node *node)
+{
+ return 0;
}
#endif
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-08-25 15:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-25 15:58 [PATCH v2 0/7] clean up and complement reset source handling Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 1/7] reset_source: use instance = -1 as default Uwe Kleine-König
2019-08-25 15:58 ` Uwe Kleine-König [this message]
2019-08-25 15:58 ` [PATCH v2 3/7] reset_source: drop reset_source_set_instance() Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 4/7] reset_source: implement helper to set a device as reset source Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 5/7] mfd: da9053: use new reset_source_set_device() Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 6/7] mfd: da9063: " Uwe Kleine-König
2019-08-25 15:58 ` [PATCH v2 7/7] oftree: expose reset_source device in device tree Uwe Kleine-König
2019-08-28 11:34 ` [PATCH v2 0/7] clean up and complement reset source handling 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=20190825155844.18455-3-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@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