diff mbox series

of: Add dummy for of_node_is_root if not CONFIG_OF

Message ID 20190507044801.250396-1-dianders@chromium.org (mailing list archive)
State New, archived
Headers show
Series of: Add dummy for of_node_is_root if not CONFIG_OF | expand

Commit Message

Doug Anderson May 7, 2019, 4:48 a.m. UTC
We'll add a dummy to just return false.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 include/linux/of.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Guenter Roeck May 7, 2019, 2:52 p.m. UTC | #1
On Mon, May 6, 2019 at 9:48 PM Douglas Anderson <dianders@chromium.org> wrote:
>
> We'll add a dummy to just return false.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

Reviewed-by: Guenter Roeck <groeck@chromium.org>

> ---
>
>  include/linux/of.h | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 0cf857012f11..62ae5c1cafa5 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -653,6 +653,11 @@ static inline bool of_have_populated_dt(void)
>         return false;
>  }
>
> +static inline bool of_node_is_root(const struct device_node *node)
> +{
> +       return false;
> +}
> +
>  static inline struct device_node *of_get_compatible_child(const struct device_node *parent,
>                                         const char *compatible)
>  {
> --
> 2.21.0.1020.gf2820cf01a-goog
>
Frank Rowand May 7, 2019, 5:52 p.m. UTC | #2
On 5/6/19 9:48 PM, Douglas Anderson wrote:
> We'll add a dummy to just return false.

A more complete explanation of why this is needed please.

My one guess would be compile testing of arch/sparc/kernel/prom_64.c
fails???

-Frank


> 
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> 
>  include/linux/of.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 0cf857012f11..62ae5c1cafa5 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -653,6 +653,11 @@ static inline bool of_have_populated_dt(void)
>  	return false;
>  }
>  
> +static inline bool of_node_is_root(const struct device_node *node)
> +{
> +	return false;
> +}
> +
>  static inline struct device_node *of_get_compatible_child(const struct device_node *parent,
>  					const char *compatible)
>  {
>
Doug Anderson May 7, 2019, 5:59 p.m. UTC | #3
Hi,


On Tue, May 7, 2019 at 10:52 AM Frank Rowand <frowand.list@gmail.com> wrote:
>
> On 5/6/19 9:48 PM, Douglas Anderson wrote:
> > We'll add a dummy to just return false.
>
> A more complete explanation of why this is needed please.
>
> My one guess would be compile testing of arch/sparc/kernel/prom_64.c
> fails???

Ah, sorry.  Needed for:

https://lkml.kernel.org/r/CAD=FV=Vxp-U7mZUNmAAOja5pt-8rZqPryEvwTg_Dv3ChuH_TrA@mail.gmail.com



-Doug
Kees Cook May 7, 2019, 9:15 p.m. UTC | #4
On Tue, May 7, 2019 at 10:59 AM Doug Anderson <dianders@chromium.org> wrote:
> On Tue, May 7, 2019 at 10:52 AM Frank Rowand <frowand.list@gmail.com> wrote:
> >
> > On 5/6/19 9:48 PM, Douglas Anderson wrote:
> > > We'll add a dummy to just return false.
> >
> > A more complete explanation of why this is needed please.
> >
> > My one guess would be compile testing of arch/sparc/kernel/prom_64.c
> > fails???
>
> Ah, sorry.  Needed for:
>
> https://lkml.kernel.org/r/CAD=FV=Vxp-U7mZUNmAAOja5pt-8rZqPryEvwTg_Dv3ChuH_TrA@mail.gmail.com

Should I take both patches via pstore, or should both go via DT tree?
Frank Rowand May 7, 2019, 10:17 p.m. UTC | #5
On 5/7/19 10:59 AM, Doug Anderson wrote:
> Hi,
> 
> 
> On Tue, May 7, 2019 at 10:52 AM Frank Rowand <frowand.list@gmail.com> wrote:
>>
>> On 5/6/19 9:48 PM, Douglas Anderson wrote:
>>> We'll add a dummy to just return false.
>>
>> A more complete explanation of why this is needed please.
>>
>> My one guess would be compile testing of arch/sparc/kernel/prom_64.c
>> fails???
> 
> Ah, sorry.  Needed for:
> 
> https://lkml.kernel.org/r/CAD=FV=Vxp-U7mZUNmAAOja5pt-8rZqPryEvwTg_Dv3ChuH_TrA@mail.gmail.com

Got it.  I went and looked at that.  I think a better approach would be to
check parent node not "/reserved-memory".  I am making this suggestion in
that email thread.

-Frank

> 
> 
> 
> -Doug
> .
>
Doug Anderson May 8, 2019, 3:51 p.m. UTC | #6
Hi,

On Tue, May 7, 2019 at 3:17 PM Frank Rowand <frowand.list@gmail.com> wrote:
>
> On 5/7/19 10:59 AM, Doug Anderson wrote:
> > Hi,
> >
> >
> > On Tue, May 7, 2019 at 10:52 AM Frank Rowand <frowand.list@gmail.com> wrote:
> >>
> >> On 5/6/19 9:48 PM, Douglas Anderson wrote:
> >>> We'll add a dummy to just return false.
> >>
> >> A more complete explanation of why this is needed please.
> >>
> >> My one guess would be compile testing of arch/sparc/kernel/prom_64.c
> >> fails???
> >
> > Ah, sorry.  Needed for:
> >
> > https://lkml.kernel.org/r/CAD=FV=Vxp-U7mZUNmAAOja5pt-8rZqPryEvwTg_Dv3ChuH_TrA@mail.gmail.com
>
> Got it.  I went and looked at that.  I think a better approach would be to
> check parent node not "/reserved-memory".  I am making this suggestion in
> that email thread.

OK.  Assuming that people are happy with that approach [1], we should
consider this patch abandoned.  Thanks for your reviews!

[1] https://lkml.kernel.org/r/20190508154832.241525-1-dianders@chromium.org

-Doug
diff mbox series

Patch

diff --git a/include/linux/of.h b/include/linux/of.h
index 0cf857012f11..62ae5c1cafa5 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -653,6 +653,11 @@  static inline bool of_have_populated_dt(void)
 	return false;
 }
 
+static inline bool of_node_is_root(const struct device_node *node)
+{
+	return false;
+}
+
 static inline struct device_node *of_get_compatible_child(const struct device_node *parent,
 					const char *compatible)
 {