From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kernel@vger.kernel.org
Cc: Hans de Goede <hdegoede@redhat.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Lee Jones <lee.jones@linaro.org>,
Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: [PATCH] reset: add WARN_ON(1) to non-optional reset_control_get variants
Date: Fri, 8 Jul 2016 19:30:33 +0900 [thread overview]
Message-ID: <1467973833-12466-1-git-send-email-yamada.masahiro@socionext.com> (raw)
The difference between with/without _optional variants is WARN_ON(1)
when CONFIG_RESET_CONTROLLER is not defined.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
include/linux/reset.h | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/include/linux/reset.h b/include/linux/reset.h
index 45a4abe..cb7db61 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -132,6 +132,9 @@ __must_check reset_control_get_exclusive(struct device *dev, const char *id)
static inline struct reset_control *reset_control_get_shared(
struct device *dev, const char *id)
{
+#ifndef CONFIG_RESET_CONTROLLER
+ WARN_ON(1);
+#endif
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
}
@@ -160,6 +163,9 @@ static inline struct reset_control *reset_control_get_optional_shared(
static inline struct reset_control *of_reset_control_get_exclusive(
struct device_node *node, const char *id)
{
+#ifndef CONFIG_RESET_CONTROLLER
+ WARN_ON(1);
+#endif
return __of_reset_control_get(node, id, 0, 0);
}
@@ -185,6 +191,9 @@ static inline struct reset_control *of_reset_control_get_exclusive(
static inline struct reset_control *of_reset_control_get_shared(
struct device_node *node, const char *id)
{
+#ifndef CONFIG_RESET_CONTROLLER
+ WARN_ON(1);
+#endif
return __of_reset_control_get(node, id, 0, 1);
}
@@ -202,6 +211,9 @@ static inline struct reset_control *of_reset_control_get_shared(
static inline struct reset_control *of_reset_control_get_exclusive_by_index(
struct device_node *node, int index)
{
+#ifndef CONFIG_RESET_CONTROLLER
+ WARN_ON(1);
+#endif
return __of_reset_control_get(node, NULL, index, 0);
}
@@ -230,6 +242,9 @@ static inline struct reset_control *of_reset_control_get_exclusive_by_index(
static inline struct reset_control *of_reset_control_get_shared_by_index(
struct device_node *node, int index)
{
+#ifndef CONFIG_RESET_CONTROLLER
+ WARN_ON(1);
+#endif
return __of_reset_control_get(node, NULL, index, 1);
}
@@ -267,6 +282,9 @@ __must_check devm_reset_control_get_exclusive(struct device *dev,
static inline struct reset_control *devm_reset_control_get_shared(
struct device *dev, const char *id)
{
+#ifndef CONFIG_RESET_CONTROLLER
+ WARN_ON(1);
+#endif
return __devm_reset_control_get(dev, id, 0, 1);
}
@@ -297,6 +315,9 @@ static inline struct reset_control *devm_reset_control_get_optional_shared(
static inline struct reset_control *
devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
{
+#ifndef CONFIG_RESET_CONTROLLER
+ WARN_ON(1);
+#endif
return __devm_reset_control_get(dev, NULL, index, 0);
}
@@ -313,6 +334,9 @@ devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
static inline struct reset_control *
devm_reset_control_get_shared_by_index(struct device *dev, int index)
{
+#ifndef CONFIG_RESET_CONTROLLER
+ WARN_ON(1);
+#endif
return __devm_reset_control_get(dev, NULL, index, 1);
}
--
1.9.1
next reply other threads:[~2016-07-08 10:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-08 10:30 Masahiro Yamada [this message]
2016-07-11 10:50 ` Philipp Zabel
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=1467973833-12466-1-git-send-email-yamada.masahiro@socionext.com \
--to=yamada.masahiro@socionext.com \
--cc=hdegoede@redhat.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
/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
all inboxes | Powered by JetHome®