From: Alan Tull <atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Moritz Fischer <mdf-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Frank Rowand
<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
Cc: Alan Tull <atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-fpga-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 2/2] of: dynamic: add overlay-allowed DT property
Date: Mon, 4 Dec 2017 13:13:57 -0600 [thread overview]
Message-ID: <20171204191357.3211-3-atull@kernel.org> (raw)
In-Reply-To: <20171204191357.3211-1-atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Allow DT nodes to be marked as valid targets for DT
overlays by the added "overlay-allowed" property.
Signed-off-by: Alan Tull <atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
drivers/of/base.c | 4 ++--
drivers/of/dynamic.c | 3 +++
drivers/of/fdt.c | 3 +++
drivers/of/of_private.h | 2 ++
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 26618ba..ac6b326 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -116,8 +116,8 @@ void __init of_core_init(void)
proc_symlink("device-tree", NULL, "/sys/firmware/devicetree/base");
}
-static struct property *__of_find_property(const struct device_node *np,
- const char *name, int *lenp)
+struct property *__of_find_property(const struct device_node *np,
+ const char *name, int *lenp)
{
struct property *pp;
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index ab988d8..fae9b85 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -207,6 +207,9 @@ static void __of_attach_node(struct device_node *np)
np->name = __of_get_property(np, "name", NULL) ? : "<NULL>";
np->type = __of_get_property(np, "device_type", NULL) ? : "<NULL>";
+ if (__of_find_property(np, "overlay-allowed", NULL))
+ of_node_set_flag(np, OF_OVERLAY_ENABLED);
+
phandle = __of_get_property(np, "phandle", &sz);
if (!phandle)
phandle = __of_get_property(np, "linux,phandle", &sz);
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 4675e5a..9237f30 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -323,6 +323,9 @@ static bool populate_node(const void *blob,
np->name = "<NULL>";
if (!np->type)
np->type = "<NULL>";
+
+ if (of_find_property(np, "overlay-allowed", NULL))
+ of_node_set_flag(np, OF_OVERLAY_ENABLED);
}
*pnp = np;
diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h
index 92a9a36..75fcba3 100644
--- a/drivers/of/of_private.h
+++ b/drivers/of/of_private.h
@@ -115,6 +115,8 @@ struct device_node *__of_find_node_by_path(struct device_node *parent,
struct device_node *__of_find_node_by_full_path(struct device_node *node,
const char *path);
+extern struct property *__of_find_property(const struct device_node *np,
+ const char *name, int *lenp);
extern const void *__of_get_property(const struct device_node *np,
const char *name, int *lenp);
extern int __of_add_property(struct device_node *np, struct property *prop);
--
2.7.4
--
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 prev parent reply other threads:[~2017-12-04 19:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 19:13 [PATCH 0/2] of: dynamic: restrict overlay by targets Alan Tull
[not found] ` <20171204191357.3211-1-atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-12-04 19:13 ` [PATCH 1/2] of: overlay: add flag enabling overlays and enable fpga-region overlays Alan Tull
2017-12-04 19:13 ` Alan Tull [this message]
[not found] ` <20171204191357.3211-3-atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-12-04 20:04 ` [PATCH 2/2] of: dynamic: add overlay-allowed DT property Rob Herring
[not found] ` <CAL_Jsq+f4q=8rvxndbJNkp5KNMYRoKHs-zKOL1zwXfS0T2A3mA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-04 20:12 ` Alan Tull
2017-12-04 19:18 ` [PATCH 0/2] of: dynamic: restrict overlay by targets Moritz Fischer
2017-12-04 19:20 ` Moritz Fischer
2017-12-05 1:14 ` Frank Rowand
2017-12-05 17:07 ` Alan Tull
[not found] ` <CANk1AXQ4HV9YAO_p1wrY66nnWY1n2WnR0JoCbAKU6RfrWqf9sQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-06 11:58 ` Frank Rowand
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=20171204191357.3211-3-atull@kernel.org \
--to=atull-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-fpga-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mdf-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+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).