devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: Add more stubs for non-OF builds
@ 2013-06-17 17:24 Alexander Shiyan
       [not found] ` <1371489882-11143-1-git-send-email-shc_work-JGs/UdohzUI@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Alexander Shiyan @ 2013-06-17 17:24 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
  Cc: Grant Likely, Bryan Wu, Rob Herring,
	linux-leds-u79uwXL29TY76Z2rM5mHXA, Alexander Shiyan

Patch adds of_get_next_child and of_get_next_available_child
stubs for non-OF builds.

Signed-off-by: Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org>
---
 include/linux/of.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/include/linux/of.h b/include/linux/of.h
index 1fd08ca..df0e644 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -366,8 +366,17 @@ static inline bool of_have_populated_dt(void)
 	return false;
 }
 
-#define for_each_child_of_node(parent, child) \
-	while (0)
+static struct device_node *of_get_next_child(const struct device_node *node,
+					     struct device_node *prev)
+{
+	return NULL;
+}
+
+static struct device_node *of_get_next_available_child(
+	const struct device_node *node, struct device_node *prev)
+{
+	return NULL;
+}
 
 static inline struct device_node *of_get_child_by_name(
 					const struct device_node *node,
@@ -376,6 +385,9 @@ static inline struct device_node *of_get_child_by_name(
 	return NULL;
 }
 
+#define for_each_child_of_node(parent, child) \
+	while (0)
+
 static inline int of_get_child_count(const struct device_node *np)
 {
 	return 0;
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] of: Add more stubs for non-OF builds
       [not found] ` <1371489882-11143-1-git-send-email-shc_work-JGs/UdohzUI@public.gmane.org>
@ 2013-06-18 16:25   ` Rob Herring
       [not found]     ` <51C089F6.2060902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Rob Herring @ 2013-06-18 16:25 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: Grant Likely, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Bryan Wu,
	linux-leds-u79uwXL29TY76Z2rM5mHXA, Rob Herring

Perhaps a more specific subject.

On 06/17/2013 12:24 PM, Alexander Shiyan wrote:
> Patch adds of_get_next_child and of_get_next_available_child
> stubs for non-OF builds.
> 
> Signed-off-by: Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org>
> ---

What changed for v2?

>  include/linux/of.h | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 1fd08ca..df0e644 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -366,8 +366,17 @@ static inline bool of_have_populated_dt(void)
>  	return false;
>  }
>  
> -#define for_each_child_of_node(parent, child) \
> -	while (0)
> +static struct device_node *of_get_next_child(const struct device_node *node,
> +					     struct device_node *prev)
> +{
> +	return NULL;
> +}
> +
> +static struct device_node *of_get_next_available_child(
> +	const struct device_node *node, struct device_node *prev)
> +{
> +	return NULL;
> +}
>  
>  static inline struct device_node *of_get_child_by_name(
>  					const struct device_node *node,
> @@ -376,6 +385,9 @@ static inline struct device_node *of_get_child_by_name(
>  	return NULL;
>  }
>  
> +#define for_each_child_of_node(parent, child) \

parent and child need unused annotations to avoid unused variable warnings.

Rob

> +	while (0)
> +
>  static inline int of_get_child_count(const struct device_node *np)
>  {
>  	return 0;
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] of: Add more stubs for non-OF builds
       [not found]     ` <51C089F6.2060902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-06-18 16:35       ` Alexander Shiyan
       [not found]         ` <1371573337.452797583-x9YND1UlJWJsdVUOrk1QfQ@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Alexander Shiyan @ 2013-06-18 16:35 UTC (permalink / raw)
  To: Rob Herring
  Cc: Grant Likely, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Bryan Wu,
	linux-leds-u79uwXL29TY76Z2rM5mHXA, Rob Herring

> Perhaps a more specific subject.

I can just specify stub function names in the subject.
Is this enough?

> On 06/17/2013 12:24 PM, Alexander Shiyan wrote:
> > Patch adds of_get_next_child and of_get_next_available_child
> > stubs for non-OF builds.
> > 
> > Signed-off-by: Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org>
> > ---
> 
> What changed for v2?

v1 not contain "inline" for prototypes.

> >  include/linux/of.h | 16 ++++++++++++++--
> >  1 file changed, 14 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/linux/of.h b/include/linux/of.h
> > index 1fd08ca..df0e644 100644
> > --- a/include/linux/of.h
> > +++ b/include/linux/of.h
> > @@ -366,8 +366,17 @@ static inline bool of_have_populated_dt(void)
> >  	return false;
> >  }
> >  
> > -#define for_each_child_of_node(parent, child) \
> > -	while (0)
> > +static struct device_node *of_get_next_child(const struct device_node *node,
> > +					     struct device_node *prev)
> > +{
> > +	return NULL;
> > +}
> > +
> > +static struct device_node *of_get_next_available_child(
> > +	const struct device_node *node, struct device_node *prev)
> > +{
> > +	return NULL;
> > +}
> >  
> >  static inline struct device_node *of_get_child_by_name(
> >  					const struct device_node *node,
> > @@ -376,6 +385,9 @@ static inline struct device_node *of_get_child_by_name(
> >  	return NULL;
> >  }
> >  
> > +#define for_each_child_of_node(parent, child) \
> 
> parent and child need unused annotations to avoid unused variable warnings.

This define has been moved just for keep same order as for OF-version.

---

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] of: Add more stubs for non-OF builds
       [not found]         ` <1371573337.452797583-x9YND1UlJWJsdVUOrk1QfQ@public.gmane.org>
@ 2013-06-20 23:49           ` Bryan Wu
       [not found]             ` <CAK5ve-+96fNSF0cV1gefzgJNFX-nefZ08HWupPirQYauecEQYw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Bryan Wu @ 2013-06-20 23:49 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: Grant Likely,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Linux LED Subsystem, Rob Herring

Hi Rob,

Is this patch good for merging?

In Alex's one patch to add device tree supporting for a leds driver,
we got building errors due to miss definitions of some of_xxx api
functions.

It looks obviously to me that we need to fix this in device tree core
instead put #ifdef CONFIG_OF everywhere.

Thanks,
-Bryan

On Tue, Jun 18, 2013 at 9:35 AM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
>> Perhaps a more specific subject.
>
> I can just specify stub function names in the subject.
> Is this enough?
>
>> On 06/17/2013 12:24 PM, Alexander Shiyan wrote:
>> > Patch adds of_get_next_child and of_get_next_available_child
>> > stubs for non-OF builds.
>> >
>> > Signed-off-by: Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org>
>> > ---
>>
>> What changed for v2?
>
> v1 not contain "inline" for prototypes.
>
>> >  include/linux/of.h | 16 ++++++++++++++--
>> >  1 file changed, 14 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/include/linux/of.h b/include/linux/of.h
>> > index 1fd08ca..df0e644 100644
>> > --- a/include/linux/of.h
>> > +++ b/include/linux/of.h
>> > @@ -366,8 +366,17 @@ static inline bool of_have_populated_dt(void)
>> >     return false;
>> >  }
>> >
>> > -#define for_each_child_of_node(parent, child) \
>> > -   while (0)
>> > +static struct device_node *of_get_next_child(const struct device_node *node,
>> > +                                        struct device_node *prev)
>> > +{
>> > +   return NULL;
>> > +}
>> > +
>> > +static struct device_node *of_get_next_available_child(
>> > +   const struct device_node *node, struct device_node *prev)
>> > +{
>> > +   return NULL;
>> > +}
>> >
>> >  static inline struct device_node *of_get_child_by_name(
>> >                                     const struct device_node *node,
>> > @@ -376,6 +385,9 @@ static inline struct device_node *of_get_child_by_name(
>> >     return NULL;
>> >  }
>> >
>> > +#define for_each_child_of_node(parent, child) \
>>
>> parent and child need unused annotations to avoid unused variable warnings.
>
> This define has been moved just for keep same order as for OF-version.
>
> ---

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] of: Add more stubs for non-OF builds
       [not found]             ` <CAK5ve-+96fNSF0cV1gefzgJNFX-nefZ08HWupPirQYauecEQYw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-06-21  0:26               ` Grant Likely
  2013-06-21  0:36                 ` Bryan Wu
  0 siblings, 1 reply; 14+ messages in thread
From: Grant Likely @ 2013-06-21  0:26 UTC (permalink / raw)
  To: Bryan Wu, Alexander Shiyan
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Linux LED Subsystem, Rob Herring

On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi Rob,
> 
> Is this patch good for merging?
> 
> In Alex's one patch to add device tree supporting for a leds driver,
> we got building errors due to miss definitions of some of_xxx api
> functions.
> 
> It looks obviously to me that we need to fix this in device tree core
> instead put #ifdef CONFIG_OF everywhere.

Actually, the reason those things aren't universally defined is to catch
exactly what it caught. The "leds-mc13783: Add devicetree support" patch
interleaves DT and non-DT parsing which isn't generally a good idea. The
DT parsing code should be shuffled off into a separate function and/or
contained with "if (IS_ENABLED(CONFIG_OF)) {}".

So, no, I don't want this patch merged.

g.


> 
> Thanks,
> -Bryan
> 
> On Tue, Jun 18, 2013 at 9:35 AM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
> >> Perhaps a more specific subject.
> >
> > I can just specify stub function names in the subject.
> > Is this enough?
> >
> >> On 06/17/2013 12:24 PM, Alexander Shiyan wrote:
> >> > Patch adds of_get_next_child and of_get_next_available_child
> >> > stubs for non-OF builds.
> >> >
> >> > Signed-off-by: Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org>
> >> > ---
> >>
> >> What changed for v2?
> >
> > v1 not contain "inline" for prototypes.
> >
> >> >  include/linux/of.h | 16 ++++++++++++++--
> >> >  1 file changed, 14 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/include/linux/of.h b/include/linux/of.h
> >> > index 1fd08ca..df0e644 100644
> >> > --- a/include/linux/of.h
> >> > +++ b/include/linux/of.h
> >> > @@ -366,8 +366,17 @@ static inline bool of_have_populated_dt(void)
> >> >     return false;
> >> >  }
> >> >
> >> > -#define for_each_child_of_node(parent, child) \
> >> > -   while (0)
> >> > +static struct device_node *of_get_next_child(const struct device_node *node,
> >> > +                                        struct device_node *prev)
> >> > +{
> >> > +   return NULL;
> >> > +}
> >> > +
> >> > +static struct device_node *of_get_next_available_child(
> >> > +   const struct device_node *node, struct device_node *prev)
> >> > +{
> >> > +   return NULL;
> >> > +}
> >> >
> >> >  static inline struct device_node *of_get_child_by_name(
> >> >                                     const struct device_node *node,
> >> > @@ -376,6 +385,9 @@ static inline struct device_node *of_get_child_by_name(
> >> >     return NULL;
> >> >  }
> >> >
> >> > +#define for_each_child_of_node(parent, child) \
> >>
> >> parent and child need unused annotations to avoid unused variable warnings.
> >
> > This define has been moved just for keep same order as for OF-version.
> >
> > ---

-- 
email sent from notmuch.vim plugin

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] of: Add more stubs for non-OF builds
  2013-06-21  0:26               ` Grant Likely
@ 2013-06-21  0:36                 ` Bryan Wu
       [not found]                   ` <CAK5ve-JX1BC-jdpSzBx_en_o4FYjie-1GRL39B18NywUvXAHrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Bryan Wu @ 2013-06-21  0:36 UTC (permalink / raw)
  To: Grant Likely
  Cc: Linux LED Subsystem,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Rob Herring, Alexander Shiyan

On Thu, Jun 20, 2013 at 5:26 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Hi Rob,
>>
>> Is this patch good for merging?
>>
>> In Alex's one patch to add device tree supporting for a leds driver,
>> we got building errors due to miss definitions of some of_xxx api
>> functions.
>>
>> It looks obviously to me that we need to fix this in device tree core
>> instead put #ifdef CONFIG_OF everywhere.
>
> Actually, the reason those things aren't universally defined is to catch
> exactly what it caught. The "leds-mc13783: Add devicetree support" patch
> interleaves DT and non-DT parsing which isn't generally a good idea. The
> DT parsing code should be shuffled off into a separate function and/or
> contained with "if (IS_ENABLED(CONFIG_OF)) {}".
>

Agree, reasonable! I will remove this patch from my tree firstly.

Alex, could you please update your patch with Grant's feedback?

Thanks,
-Bryan


> So, no, I don't want this patch merged.
>
> g.
>
>
>>
>> Thanks,
>> -Bryan
>>
>> On Tue, Jun 18, 2013 at 9:35 AM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
>> >> Perhaps a more specific subject.
>> >
>> > I can just specify stub function names in the subject.
>> > Is this enough?
>> >
>> >> On 06/17/2013 12:24 PM, Alexander Shiyan wrote:
>> >> > Patch adds of_get_next_child and of_get_next_available_child
>> >> > stubs for non-OF builds.
>> >> >
>> >> > Signed-off-by: Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org>
>> >> > ---
>> >>
>> >> What changed for v2?
>> >
>> > v1 not contain "inline" for prototypes.
>> >
>> >> >  include/linux/of.h | 16 ++++++++++++++--
>> >> >  1 file changed, 14 insertions(+), 2 deletions(-)
>> >> >
>> >> > diff --git a/include/linux/of.h b/include/linux/of.h
>> >> > index 1fd08ca..df0e644 100644
>> >> > --- a/include/linux/of.h
>> >> > +++ b/include/linux/of.h
>> >> > @@ -366,8 +366,17 @@ static inline bool of_have_populated_dt(void)
>> >> >     return false;
>> >> >  }
>> >> >
>> >> > -#define for_each_child_of_node(parent, child) \
>> >> > -   while (0)
>> >> > +static struct device_node *of_get_next_child(const struct device_node *node,
>> >> > +                                        struct device_node *prev)
>> >> > +{
>> >> > +   return NULL;
>> >> > +}
>> >> > +
>> >> > +static struct device_node *of_get_next_available_child(
>> >> > +   const struct device_node *node, struct device_node *prev)
>> >> > +{
>> >> > +   return NULL;
>> >> > +}
>> >> >
>> >> >  static inline struct device_node *of_get_child_by_name(
>> >> >                                     const struct device_node *node,
>> >> > @@ -376,6 +385,9 @@ static inline struct device_node *of_get_child_by_name(
>> >> >     return NULL;
>> >> >  }
>> >> >
>> >> > +#define for_each_child_of_node(parent, child) \
>> >>
>> >> parent and child need unused annotations to avoid unused variable warnings.
>> >
>> > This define has been moved just for keep same order as for OF-version.
>> >
>> > ---
>
> --
> email sent from notmuch.vim plugin

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] of: Add more stubs for non-OF builds
       [not found]                   ` <CAK5ve-JX1BC-jdpSzBx_en_o4FYjie-1GRL39B18NywUvXAHrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-06-21 10:21                     ` Grant Likely
  2013-06-21 14:17                     ` Re[2]: " Alexander Shiyan
  1 sibling, 0 replies; 14+ messages in thread
From: Grant Likely @ 2013-06-21 10:21 UTC (permalink / raw)
  To: Bryan Wu
  Cc: Linux LED Subsystem,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Rob Herring, Alexander Shiyan

On Fri, Jun 21, 2013 at 1:36 AM, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Thu, Jun 20, 2013 at 5:26 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>> On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> Hi Rob,
>>>
>>> Is this patch good for merging?
>>>
>>> In Alex's one patch to add device tree supporting for a leds driver,
>>> we got building errors due to miss definitions of some of_xxx api
>>> functions.
>>>
>>> It looks obviously to me that we need to fix this in device tree core
>>> instead put #ifdef CONFIG_OF everywhere.
>>
>> Actually, the reason those things aren't universally defined is to catch
>> exactly what it caught. The "leds-mc13783: Add devicetree support" patch
>> interleaves DT and non-DT parsing which isn't generally a good idea. The
>> DT parsing code should be shuffled off into a separate function and/or
>> contained with "if (IS_ENABLED(CONFIG_OF)) {}".
>>
>
> Agree, reasonable! I will remove this patch from my tree firstly.
>
> Alex, could you please update your patch with Grant's feedback?
>
> Thanks,
> -Bryan

Thanks Bryan,

g.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re[2]: [PATCH] of: Add more stubs for non-OF builds
       [not found]                   ` <CAK5ve-JX1BC-jdpSzBx_en_o4FYjie-1GRL39B18NywUvXAHrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2013-06-21 10:21                     ` Grant Likely
@ 2013-06-21 14:17                     ` Alexander Shiyan
       [not found]                       ` <1371824246.856851759-pyBXd9eNxi0edp2WBT/QOw@public.gmane.org>
  2013-06-21 17:21                       ` Re[4]: " Alexander Shiyan
  1 sibling, 2 replies; 14+ messages in thread
From: Alexander Shiyan @ 2013-06-21 14:17 UTC (permalink / raw)
  To: Bryan Wu
  Cc: Grant Likely, devicetree-discuss@lists.ozlabs.org,
	Linux LED Subsystem, Rob Herring

> On Thu, Jun 20, 2013 at 5:26 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> > On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> Hi Rob,
> >>
> >> Is this patch good for merging?
> >>
> >> In Alex's one patch to add device tree supporting for a leds driver,
> >> we got building errors due to miss definitions of some of_xxx api
> >> functions.
> >>
> >> It looks obviously to me that we need to fix this in device tree core
> >> instead put #ifdef CONFIG_OF everywhere.
> >
> > Actually, the reason those things aren't universally defined is to catch
> > exactly what it caught. The "leds-mc13783: Add devicetree support" patch
> > interleaves DT and non-DT parsing which isn't generally a good idea. The
> > DT parsing code should be shuffled off into a separate function and/or
> > contained with "if (IS_ENABLED(CONFIG_OF)) {}".
> >
> 
> Agree, reasonable! I will remove this patch from my tree firstly.
> 
> Alex, could you please update your patch with Grant's feedback?

As far I understand you mean only the last part of patch. Where DT support
is introduced. Is not it?

---

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Re[2]: [PATCH] of: Add more stubs for non-OF builds
       [not found]                       ` <1371824246.856851759-pyBXd9eNxi0edp2WBT/QOw@public.gmane.org>
@ 2013-06-21 17:13                         ` Bryan Wu
  0 siblings, 0 replies; 14+ messages in thread
From: Bryan Wu @ 2013-06-21 17:13 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: Grant Likely,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Linux LED Subsystem, Rob Herring

On Fri, Jun 21, 2013 at 7:17 AM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
>> On Thu, Jun 20, 2013 at 5:26 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>> > On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> >> Hi Rob,
>> >>
>> >> Is this patch good for merging?
>> >>
>> >> In Alex's one patch to add device tree supporting for a leds driver,
>> >> we got building errors due to miss definitions of some of_xxx api
>> >> functions.
>> >>
>> >> It looks obviously to me that we need to fix this in device tree core
>> >> instead put #ifdef CONFIG_OF everywhere.
>> >
>> > Actually, the reason those things aren't universally defined is to catch
>> > exactly what it caught. The "leds-mc13783: Add devicetree support" patch
>> > interleaves DT and non-DT parsing which isn't generally a good idea. The
>> > DT parsing code should be shuffled off into a separate function and/or
>> > contained with "if (IS_ENABLED(CONFIG_OF)) {}".
>> >
>>
>> Agree, reasonable! I will remove this patch from my tree firstly.
>>
>> Alex, could you please update your patch with Grant's feedback?
>
> As far I understand you mean only the last part of patch. Where DT support
> is introduced. Is not it?
>

Yes, exactly. I still keep those 2 non-DT related patches in my tree
and just removed that DT supporting patch.

Please update that patch and posted again to linux-leds and DT
maintainers as well.

Thanks,
-Bryan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re[4]: [PATCH] of: Add more stubs for non-OF builds
  2013-06-21 14:17                     ` Re[2]: " Alexander Shiyan
       [not found]                       ` <1371824246.856851759-pyBXd9eNxi0edp2WBT/QOw@public.gmane.org>
@ 2013-06-21 17:21                       ` Alexander Shiyan
       [not found]                         ` <1371835275.689989846-g6/BKhZsNKQedp2WBT/QOw@public.gmane.org>
  2013-06-21 18:35                         ` Re[6]: " Alexander Shiyan
  1 sibling, 2 replies; 14+ messages in thread
From: Alexander Shiyan @ 2013-06-21 17:21 UTC (permalink / raw)
  To: Bryan Wu
  Cc: Grant Likely, devicetree-discuss@lists.ozlabs.org,
	Linux LED Subsystem, Rob Herring

> On Fri, Jun 21, 2013 at 7:17 AM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
> >> On Thu, Jun 20, 2013 at 5:26 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> >> > On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> >> Hi Rob,
> >> >>
> >> >> Is this patch good for merging?
> >> >>
> >> >> In Alex's one patch to add device tree supporting for a leds driver,
> >> >> we got building errors due to miss definitions of some of_xxx api
> >> >> functions.
> >> >>
> >> >> It looks obviously to me that we need to fix this in device tree core
> >> >> instead put #ifdef CONFIG_OF everywhere.
> >> >
> >> > Actually, the reason those things aren't universally defined is to catch
> >> > exactly what it caught. The "leds-mc13783: Add devicetree support" patch
> >> > interleaves DT and non-DT parsing which isn't generally a good idea. The
> >> > DT parsing code should be shuffled off into a separate function and/or
> >> > contained with "if (IS_ENABLED(CONFIG_OF)) {}".
> >> >
> >>
> >> Agree, reasonable! I will remove this patch from my tree firstly.
> >>
> >> Alex, could you please update your patch with Grant's feedback?
> >
> > As far I understand you mean only the last part of patch. Where DT support
> > is introduced. Is not it?
> >
> 
> Yes, exactly. I still keep those 2 non-DT related patches in my tree
> and just removed that DT supporting patch.
> 
> Please update that patch and posted again to linux-leds and DT
> maintainers as well.

I am really dont like any #ifdef in the source, but will do if this is only
one way to put this patch into the main tree.

---

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Re[4]: [PATCH] of: Add more stubs for non-OF builds
       [not found]                         ` <1371835275.689989846-g6/BKhZsNKQedp2WBT/QOw@public.gmane.org>
@ 2013-06-21 18:22                           ` Grant Likely
  0 siblings, 0 replies; 14+ messages in thread
From: Grant Likely @ 2013-06-21 18:22 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Bryan Wu, Linux LED Subsystem, Rob Herring

On Fri, Jun 21, 2013 at 6:21 PM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
>> On Fri, Jun 21, 2013 at 7:17 AM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
>> >> On Thu, Jun 20, 2013 at 5:26 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>> >> > On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> >> >> Hi Rob,
>> >> >>
>> >> >> Is this patch good for merging?
>> >> >>
>> >> >> In Alex's one patch to add device tree supporting for a leds driver,
>> >> >> we got building errors due to miss definitions of some of_xxx api
>> >> >> functions.
>> >> >>
>> >> >> It looks obviously to me that we need to fix this in device tree core
>> >> >> instead put #ifdef CONFIG_OF everywhere.
>> >> >
>> >> > Actually, the reason those things aren't universally defined is to catch
>> >> > exactly what it caught. The "leds-mc13783: Add devicetree support" patch
>> >> > interleaves DT and non-DT parsing which isn't generally a good idea. The
>> >> > DT parsing code should be shuffled off into a separate function and/or
>> >> > contained with "if (IS_ENABLED(CONFIG_OF)) {}".
>> >> >
>> >>
>> >> Agree, reasonable! I will remove this patch from my tree firstly.
>> >>
>> >> Alex, could you please update your patch with Grant's feedback?
>> >
>> > As far I understand you mean only the last part of patch. Where DT support
>> > is introduced. Is not it?
>> >
>>
>> Yes, exactly. I still keep those 2 non-DT related patches in my tree
>> and just removed that DT supporting patch.
>>
>> Please update that patch and posted again to linux-leds and DT
>> maintainers as well.
>
> I am really dont like any #ifdef in the source, but will do if this is only
> one way to put this patch into the main tree.

You don't need any #ifdefs. Put all the DT-related calls into a
separate function specifically for decoding the DT information and
wrap the contents with:

    if (IS_ENABLED(CONFIG_OF)) { }

g.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re[6]: [PATCH] of: Add more stubs for non-OF builds
  2013-06-21 17:21                       ` Re[4]: " Alexander Shiyan
       [not found]                         ` <1371835275.689989846-g6/BKhZsNKQedp2WBT/QOw@public.gmane.org>
@ 2013-06-21 18:35                         ` Alexander Shiyan
       [not found]                           ` <1371839716.602513920-Sq8Ym99z60Iedp2WBT/QOw@public.gmane.org>
  1 sibling, 1 reply; 14+ messages in thread
From: Alexander Shiyan @ 2013-06-21 18:35 UTC (permalink / raw)
  To: Grant Likely
  Cc: devicetree-discuss@lists.ozlabs.org, Bryan Wu,
	Linux LED Subsystem, Rob Herring

> >> On Fri, Jun 21, 2013 at 7:17 AM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
> >> >> On Thu, Jun 20, 2013 at 5:26 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> >> >> > On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> >> >> Hi Rob,
> >> >> >>
> >> >> >> Is this patch good for merging?
> >> >> >>
> >> >> >> In Alex's one patch to add device tree supporting for a leds driver,
> >> >> >> we got building errors due to miss definitions of some of_xxx api
> >> >> >> functions.
> >> >> >>
> >> >> >> It looks obviously to me that we need to fix this in device tree core
> >> >> >> instead put #ifdef CONFIG_OF everywhere.
> >> >> >
> >> >> > Actually, the reason those things aren't universally defined is to catch
> >> >> > exactly what it caught. The "leds-mc13783: Add devicetree support" patch
> >> >> > interleaves DT and non-DT parsing which isn't generally a good idea. The
> >> >> > DT parsing code should be shuffled off into a separate function and/or
> >> >> > contained with "if (IS_ENABLED(CONFIG_OF)) {}".
> >> >> >
> >> >>
> >> >> Agree, reasonable! I will remove this patch from my tree firstly.
> >> >>
> >> >> Alex, could you please update your patch with Grant's feedback?
> >> >
> >> > As far I understand you mean only the last part of patch. Where DT support
> >> > is introduced. Is not it?
> >> >
> >>
> >> Yes, exactly. I still keep those 2 non-DT related patches in my tree
> >> and just removed that DT supporting patch.
> >>
> >> Please update that patch and posted again to linux-leds and DT
> >> maintainers as well.
> >
> > I am really dont like any #ifdef in the source, but will do if this is only
> > one way to put this patch into the main tree.
> 
> You don't need any #ifdefs. Put all the DT-related calls into a
> separate function specifically for decoding the DT information and
> wrap the contents with:
> 
>     if (IS_ENABLED(CONFIG_OF)) { }

This macro does not help for undefined reference, unfortunately.
So #ifdef and/or stubs for OF-functions is needed in this case anymore.

if (IS_ENABLED(CONFIG_OF))
  some = of_get_next_child(foo, bar);
will produce an error at compile time if OF is not enabled,
because we have not empty function (if !OF) for this.

---

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Re[6]: [PATCH] of: Add more stubs for non-OF builds
       [not found]                           ` <1371839716.602513920-Sq8Ym99z60Iedp2WBT/QOw@public.gmane.org>
@ 2013-06-21 18:56                             ` Grant Likely
       [not found]                               ` <CACxGe6uqng-s4KtSwQ-MEUQ3Ed9_moNw_KvZeaPoN2OaGZnNWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Grant Likely @ 2013-06-21 18:56 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Bryan Wu, Linux LED Subsystem, Rob Herring

On Fri, Jun 21, 2013 at 7:35 PM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
>> >> On Fri, Jun 21, 2013 at 7:17 AM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
>> >> >> On Thu, Jun 20, 2013 at 5:26 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>> >> >> > On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> >> >> >> Hi Rob,
>> >> >> >>
>> >> >> >> Is this patch good for merging?
>> >> >> >>
>> >> >> >> In Alex's one patch to add device tree supporting for a leds driver,
>> >> >> >> we got building errors due to miss definitions of some of_xxx api
>> >> >> >> functions.
>> >> >> >>
>> >> >> >> It looks obviously to me that we need to fix this in device tree core
>> >> >> >> instead put #ifdef CONFIG_OF everywhere.
>> >> >> >
>> >> >> > Actually, the reason those things aren't universally defined is to catch
>> >> >> > exactly what it caught. The "leds-mc13783: Add devicetree support" patch
>> >> >> > interleaves DT and non-DT parsing which isn't generally a good idea. The
>> >> >> > DT parsing code should be shuffled off into a separate function and/or
>> >> >> > contained with "if (IS_ENABLED(CONFIG_OF)) {}".
>> >> >> >
>> >> >>
>> >> >> Agree, reasonable! I will remove this patch from my tree firstly.
>> >> >>
>> >> >> Alex, could you please update your patch with Grant's feedback?
>> >> >
>> >> > As far I understand you mean only the last part of patch. Where DT support
>> >> > is introduced. Is not it?
>> >> >
>> >>
>> >> Yes, exactly. I still keep those 2 non-DT related patches in my tree
>> >> and just removed that DT supporting patch.
>> >>
>> >> Please update that patch and posted again to linux-leds and DT
>> >> maintainers as well.
>> >
>> > I am really dont like any #ifdef in the source, but will do if this is only
>> > one way to put this patch into the main tree.
>>
>> You don't need any #ifdefs. Put all the DT-related calls into a
>> separate function specifically for decoding the DT information and
>> wrap the contents with:
>>
>>     if (IS_ENABLED(CONFIG_OF)) { }
>
> This macro does not help for undefined reference, unfortunately.
> So #ifdef and/or stubs for OF-functions is needed in this case anymore.
>
> if (IS_ENABLED(CONFIG_OF))
>   some = of_get_next_child(foo, bar);
> will produce an error at compile time if OF is not enabled,
> because we have not empty function (if !OF) for this.

Check linux-next.

g.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Re[6]: [PATCH] of: Add more stubs for non-OF builds
       [not found]                               ` <CACxGe6uqng-s4KtSwQ-MEUQ3Ed9_moNw_KvZeaPoN2OaGZnNWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-06-27  9:50                                 ` Grant Likely
  0 siblings, 0 replies; 14+ messages in thread
From: Grant Likely @ 2013-06-27  9:50 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Bryan Wu, Linux LED Subsystem, Rob Herring

On Fri, 21 Jun 2013 19:56:29 +0100, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Fri, Jun 21, 2013 at 7:35 PM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
> >> >> On Fri, Jun 21, 2013 at 7:17 AM, Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org> wrote:
> >> >> >> On Thu, Jun 20, 2013 at 5:26 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> >> >> >> > On Thu, 20 Jun 2013 16:49:54 -0700, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> >> >> >> Hi Rob,
> >> >> >> >>
> >> >> >> >> Is this patch good for merging?
> >> >> >> >>
> >> >> >> >> In Alex's one patch to add device tree supporting for a leds driver,
> >> >> >> >> we got building errors due to miss definitions of some of_xxx api
> >> >> >> >> functions.
> >> >> >> >>
> >> >> >> >> It looks obviously to me that we need to fix this in device tree core
> >> >> >> >> instead put #ifdef CONFIG_OF everywhere.
> >> >> >> >
> >> >> >> > Actually, the reason those things aren't universally defined is to catch
> >> >> >> > exactly what it caught. The "leds-mc13783: Add devicetree support" patch
> >> >> >> > interleaves DT and non-DT parsing which isn't generally a good idea. The
> >> >> >> > DT parsing code should be shuffled off into a separate function and/or
> >> >> >> > contained with "if (IS_ENABLED(CONFIG_OF)) {}".
> >> >> >> >
> >> >> >>
> >> >> >> Agree, reasonable! I will remove this patch from my tree firstly.
> >> >> >>
> >> >> >> Alex, could you please update your patch with Grant's feedback?
> >> >> >
> >> >> > As far I understand you mean only the last part of patch. Where DT support
> >> >> > is introduced. Is not it?
> >> >> >
> >> >>
> >> >> Yes, exactly. I still keep those 2 non-DT related patches in my tree
> >> >> and just removed that DT supporting patch.
> >> >>
> >> >> Please update that patch and posted again to linux-leds and DT
> >> >> maintainers as well.
> >> >
> >> > I am really dont like any #ifdef in the source, but will do if this is only
> >> > one way to put this patch into the main tree.
> >>
> >> You don't need any #ifdefs. Put all the DT-related calls into a
> >> separate function specifically for decoding the DT information and
> >> wrap the contents with:
> >>
> >>     if (IS_ENABLED(CONFIG_OF)) { }
> >
> > This macro does not help for undefined reference, unfortunately.
> > So #ifdef and/or stubs for OF-functions is needed in this case anymore.
> >
> > if (IS_ENABLED(CONFIG_OF))
> >   some = of_get_next_child(foo, bar);
> > will produce an error at compile time if OF is not enabled,
> > because we have not empty function (if !OF) for this.
> 
> Check linux-next.

Oops, my apologies, of_get_next_child is still inside the CONFIG_OF
block. Arnd had written a patch to expose some of the OF prototypes, but
that was in of_platform.h, not of.h. Use a #ifdef block around the OF
parsing helper function for now until that is fixed in the header file.

g.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-06-27  9:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-17 17:24 [PATCH] of: Add more stubs for non-OF builds Alexander Shiyan
     [not found] ` <1371489882-11143-1-git-send-email-shc_work-JGs/UdohzUI@public.gmane.org>
2013-06-18 16:25   ` Rob Herring
     [not found]     ` <51C089F6.2060902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-06-18 16:35       ` Alexander Shiyan
     [not found]         ` <1371573337.452797583-x9YND1UlJWJsdVUOrk1QfQ@public.gmane.org>
2013-06-20 23:49           ` Bryan Wu
     [not found]             ` <CAK5ve-+96fNSF0cV1gefzgJNFX-nefZ08HWupPirQYauecEQYw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-21  0:26               ` Grant Likely
2013-06-21  0:36                 ` Bryan Wu
     [not found]                   ` <CAK5ve-JX1BC-jdpSzBx_en_o4FYjie-1GRL39B18NywUvXAHrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-21 10:21                     ` Grant Likely
2013-06-21 14:17                     ` Re[2]: " Alexander Shiyan
     [not found]                       ` <1371824246.856851759-pyBXd9eNxi0edp2WBT/QOw@public.gmane.org>
2013-06-21 17:13                         ` Bryan Wu
2013-06-21 17:21                       ` Re[4]: " Alexander Shiyan
     [not found]                         ` <1371835275.689989846-g6/BKhZsNKQedp2WBT/QOw@public.gmane.org>
2013-06-21 18:22                           ` Grant Likely
2013-06-21 18:35                         ` Re[6]: " Alexander Shiyan
     [not found]                           ` <1371839716.602513920-Sq8Ym99z60Iedp2WBT/QOw@public.gmane.org>
2013-06-21 18:56                             ` Grant Likely
     [not found]                               ` <CACxGe6uqng-s4KtSwQ-MEUQ3Ed9_moNw_KvZeaPoN2OaGZnNWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-27  9:50                                 ` Grant Likely

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).