From: Gaurav Minocha <gaurav.minocha.os-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
rob.herring-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
Gaurav Minocha
<gaurav.minocha.os-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] Removes OF_SELFTEST dependency on OF_DYNAMIC config symbol
Date: Sat, 16 Aug 2014 20:03:09 -0700 [thread overview]
Message-ID: <1408244589-16930-1-git-send-email-gaurav.minocha.os@gmail.com> (raw)
This patch is used to remove the selftests dependency on
OF_DYNAMIC config flag. Now, it selectively builds
only the functions required by the selftests.
Tested with and without OF_DYNAMIC enabled.
Signed-off-by: Gaurav Minocha <gaurav.minocha.os-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/of/Kconfig | 1 -
drivers/of/Makefile | 2 +-
drivers/of/dynamic.c | 4 ++++
include/linux/of.h | 2 +-
4 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 5160c4e..1fe3805 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -10,7 +10,6 @@ menu "Device Tree and Open Firmware support"
config OF_SELFTEST
bool "Device Tree Runtime self tests"
depends on OF_IRQ && OF_EARLY_FLATTREE
- select OF_DYNAMIC
help
This option builds in test cases for the device tree infrastructure
that are executed once at boot time, and the results dumped to the
diff --git a/drivers/of/Makefile b/drivers/of/Makefile
index 2b6a7b1..5e1d493 100644
--- a/drivers/of/Makefile
+++ b/drivers/of/Makefile
@@ -6,7 +6,7 @@ obj-$(CONFIG_OF_PROMTREE) += pdt.o
obj-$(CONFIG_OF_ADDRESS) += address.o
obj-$(CONFIG_OF_IRQ) += irq.o
obj-$(CONFIG_OF_NET) += of_net.o
-obj-$(CONFIG_OF_SELFTEST) += of_selftest.o
+obj-$(CONFIG_OF_SELFTEST) += dynamic.o of_selftest.o
of_selftest-objs := selftest.o testcase-data/testcases.dtb.o
obj-$(CONFIG_OF_MDIO) += of_mdio.o
obj-$(CONFIG_OF_PCI) += of_pci.o
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index 54fecc4..37ca6af 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -82,6 +82,7 @@ int of_reconfig_notify(unsigned long action, void *p)
return notifier_to_errno(rc);
}
+#ifdef CONFIG_OF_DYNAMIC
int of_property_notify(int action, struct device_node *np,
struct property *prop, struct property *oldprop)
{
@@ -96,6 +97,7 @@ int of_property_notify(int action, struct device_node *np,
pr.old_prop = oldprop;
return of_reconfig_notify(action, &pr);
}
+#endif
void __of_attach_node(struct device_node *np)
{
@@ -200,6 +202,7 @@ int of_detach_node(struct device_node *np)
return rc;
}
+#ifdef CONFIG_OF_DYNAMIC
/**
* of_node_release() - release a dynamically allocated node
* @kref: kref element of the node to be released
@@ -658,3 +661,4 @@ int of_changeset_action(struct of_changeset *ocs, unsigned long action,
list_add_tail(&ce->node, &ocs->entries);
return 0;
}
+#endif
diff --git a/include/linux/of.h b/include/linux/of.h
index 6c4363b..ccc3f80 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -93,7 +93,7 @@ static inline int of_node_is_attached(struct device_node *node)
return node && node->kobj.state_in_sysfs;
}
-#ifdef CONFIG_OF_DYNAMIC
+#if defined(CONFIG_OF_DYNAMIC) || defined(CONFIG_OF_SELFTEST)
extern struct device_node *of_node_get(struct device_node *node);
extern void of_node_put(struct device_node *node);
#else /* CONFIG_OF_DYNAMIC */
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2014-08-17 3:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-17 3:03 Gaurav Minocha [this message]
[not found] ` <1408244589-16930-1-git-send-email-gaurav.minocha.os-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-17 13:51 ` [PATCH] Removes OF_SELFTEST dependency on OF_DYNAMIC config symbol Grant Likely
[not found] ` <20140817135145.6AE99C41205-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-08-18 16:15 ` Gaurav Minocha
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=1408244589-16930-1-git-send-email-gaurav.minocha.os@gmail.com \
--to=gaurav.minocha.os-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=rob.herring-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).