From: Grant Likely <grant.likely@linaro.org>
To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Grant Likely <grant.likely@linaro.org>,
Rob Herring <rob.herring@calxeda.com>
Subject: [PATCH] of: Document reason for missing !CONFIG_OF of_*() stubs
Date: Thu, 21 Nov 2013 13:05:36 +0000 [thread overview]
Message-ID: <1385039136-1898-1-git-send-email-grant.likely@linaro.org> (raw)
A lot of of_*() functions are not implemented to catch callers using
them without CONFIG_OF enabled. Document the reason for it in the of.h
header file so that users trying to implement more empty functions will
(hopefully) think twice before submitting more empty stub function
patches.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
---
include/linux/of.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/of.h b/include/linux/of.h
index 06d32ad62bc0..630e25df63c1 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -379,6 +379,14 @@ const char *of_prop_next_string(struct property *prop, const char *cur);
int of_device_is_stdout_path(struct device_node *dn);
#else /* CONFIG_OF */
+/*
+ * Before you add a empty functions here to fix a build error, ask yourself the
+ * following question: Will the drivers that is failing to compile ever work
+ * without CONFIG_OF?
+ *
+ * If not then make the driver depend on CONFIG_OF. Many of_*() functions do not
+ * have empty versions to catch exactly that situation.
+ */
static inline const char* of_node_full_name(struct device_node *np)
{
--
1.8.3.2
reply other threads:[~2013-11-21 13:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1385039136-1898-1-git-send-email-grant.likely@linaro.org \
--to=grant.likely@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.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
all inboxes | Powered by JetHome®