All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of: address: Don't fail a lookup just because a node has no reg property
@ 2012-07-05 14:32 ` Lee Jones
  0 siblings, 0 replies; 13+ messages in thread
From: Lee Jones @ 2012-07-05 14:32 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: STEricsson_nomadik_linux, linus.walleij, arnd, grant.likely,
	rob.herring, devicetree-discuss, Lee Jones

Sometimes it doesn't make any sense for a node to have an address.
In this case device lookup will always be unsuccessful because we
currently assume every node will have a reg property. This patch
changes the semantics so that the resource address and the lookup
address will only be compared if one exists.

Things like AUXDATA() rely on of_dev_lookup to return the lookup
entry of a particular device in order to do things like apply
platform_data to a device. However, this is currently broken for
nodes which do not have a reg property, meaning that platform_data
can not be passed in those cases.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/of/platform.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 343ad29..9600480 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -317,10 +317,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
 	for(; lookup->compatible != NULL; lookup++) {
 		if (!of_device_is_compatible(np, lookup->compatible))
 			continue;
-		if (of_address_to_resource(np, 0, &res))
-			continue;
-		if (res.start != lookup->phys_addr)
-			continue;
+		if (!of_address_to_resource(np, 0, &res))
+			if (res.start != lookup->phys_addr)
+				continue;
 		pr_debug("%s: devname=%s\n", np->full_name, lookup->name);
 		return lookup;
 	}
-- 
1.7.9.5


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

* [PATCH] of: address: Don't fail a lookup just because a node has no reg property
@ 2012-07-05 14:32 ` Lee Jones
  0 siblings, 0 replies; 13+ messages in thread
From: Lee Jones @ 2012-07-05 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

Sometimes it doesn't make any sense for a node to have an address.
In this case device lookup will always be unsuccessful because we
currently assume every node will have a reg property. This patch
changes the semantics so that the resource address and the lookup
address will only be compared if one exists.

Things like AUXDATA() rely on of_dev_lookup to return the lookup
entry of a particular device in order to do things like apply
platform_data to a device. However, this is currently broken for
nodes which do not have a reg property, meaning that platform_data
can not be passed in those cases.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/of/platform.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 343ad29..9600480 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -317,10 +317,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
 	for(; lookup->compatible != NULL; lookup++) {
 		if (!of_device_is_compatible(np, lookup->compatible))
 			continue;
-		if (of_address_to_resource(np, 0, &res))
-			continue;
-		if (res.start != lookup->phys_addr)
-			continue;
+		if (!of_address_to_resource(np, 0, &res))
+			if (res.start != lookup->phys_addr)
+				continue;
 		pr_debug("%s: devname=%s\n", np->full_name, lookup->name);
 		return lookup;
 	}
-- 
1.7.9.5

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

* Re: [PATCH] of: address: Don't fail a lookup just because a node has no reg property
  2012-07-05 14:32 ` Lee Jones
@ 2012-07-05 14:38   ` Linus Walleij
  -1 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2012-07-05 14:38 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel, linux-kernel, STEricsson_nomadik_linux,
	linus.walleij, arnd, grant.likely, rob.herring,
	devicetree-discuss

On Thu, Jul 5, 2012 at 4:32 PM, Lee Jones <lee.jones@linaro.org> wrote:

> Sometimes it doesn't make any sense for a node to have an address.
> In this case device lookup will always be unsuccessful because we
> currently assume every node will have a reg property. This patch
> changes the semantics so that the resource address and the lookup
> address will only be compared if one exists.
>
> Things like AUXDATA() rely on of_dev_lookup to return the lookup
> entry of a particular device in order to do things like apply
> platform_data to a device. However, this is currently broken for
> nodes which do not have a reg property, meaning that platform_data
> can not be passed in those cases.
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

I sure see the problem!
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* [PATCH] of: address: Don't fail a lookup just because a node has no reg property
@ 2012-07-05 14:38   ` Linus Walleij
  0 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2012-07-05 14:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 5, 2012 at 4:32 PM, Lee Jones <lee.jones@linaro.org> wrote:

> Sometimes it doesn't make any sense for a node to have an address.
> In this case device lookup will always be unsuccessful because we
> currently assume every node will have a reg property. This patch
> changes the semantics so that the resource address and the lookup
> address will only be compared if one exists.
>
> Things like AUXDATA() rely on of_dev_lookup to return the lookup
> entry of a particular device in order to do things like apply
> platform_data to a device. However, this is currently broken for
> nodes which do not have a reg property, meaning that platform_data
> can not be passed in those cases.
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

I sure see the problem!
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH] of: address: Don't fail a lookup just because a node has no reg property
  2012-07-05 14:32 ` Lee Jones
@ 2012-07-05 14:57   ` Rob Herring
  -1 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2012-07-05 14:57 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel, linux-kernel, linus.walleij, arnd,
	devicetree-discuss, rob.herring, grant.likely,
	STEricsson_nomadik_linux

On 07/05/2012 09:32 AM, Lee Jones wrote:
> Sometimes it doesn't make any sense for a node to have an address.
> In this case device lookup will always be unsuccessful because we
> currently assume every node will have a reg property. This patch
> changes the semantics so that the resource address and the lookup
> address will only be compared if one exists.
> 
> Things like AUXDATA() rely on of_dev_lookup to return the lookup
> entry of a particular device in order to do things like apply
> platform_data to a device. However, this is currently broken for
> nodes which do not have a reg property, meaning that platform_data
> can not be passed in those cases.
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---

Acked-by: Rob Herring <rob.herring@calxeda.com>

Do you have something dependent on this or want me to apply?

Rob

>  drivers/of/platform.c |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 343ad29..9600480 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -317,10 +317,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
>  	for(; lookup->compatible != NULL; lookup++) {
>  		if (!of_device_is_compatible(np, lookup->compatible))
>  			continue;
> -		if (of_address_to_resource(np, 0, &res))
> -			continue;
> -		if (res.start != lookup->phys_addr)
> -			continue;
> +		if (!of_address_to_resource(np, 0, &res))
> +			if (res.start != lookup->phys_addr)
> +				continue;
>  		pr_debug("%s: devname=%s\n", np->full_name, lookup->name);
>  		return lookup;
>  	}
> 



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

* [PATCH] of: address: Don't fail a lookup just because a node has no reg property
@ 2012-07-05 14:57   ` Rob Herring
  0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2012-07-05 14:57 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/05/2012 09:32 AM, Lee Jones wrote:
> Sometimes it doesn't make any sense for a node to have an address.
> In this case device lookup will always be unsuccessful because we
> currently assume every node will have a reg property. This patch
> changes the semantics so that the resource address and the lookup
> address will only be compared if one exists.
> 
> Things like AUXDATA() rely on of_dev_lookup to return the lookup
> entry of a particular device in order to do things like apply
> platform_data to a device. However, this is currently broken for
> nodes which do not have a reg property, meaning that platform_data
> can not be passed in those cases.
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---

Acked-by: Rob Herring <rob.herring@calxeda.com>

Do you have something dependent on this or want me to apply?

Rob

>  drivers/of/platform.c |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 343ad29..9600480 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -317,10 +317,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
>  	for(; lookup->compatible != NULL; lookup++) {
>  		if (!of_device_is_compatible(np, lookup->compatible))
>  			continue;
> -		if (of_address_to_resource(np, 0, &res))
> -			continue;
> -		if (res.start != lookup->phys_addr)
> -			continue;
> +		if (!of_address_to_resource(np, 0, &res))
> +			if (res.start != lookup->phys_addr)
> +				continue;
>  		pr_debug("%s: devname=%s\n", np->full_name, lookup->name);
>  		return lookup;
>  	}
> 

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

* Re: [PATCH] of: address: Don't fail a lookup just because a node has no reg property
  2012-07-05 14:57   ` Rob Herring
@ 2012-07-05 15:17     ` Lee Jones
  -1 siblings, 0 replies; 13+ messages in thread
From: Lee Jones @ 2012-07-05 15:17 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linus.walleij, arnd,
	devicetree-discuss, rob.herring, grant.likely,
	STEricsson_nomadik_linux

On 05/07/12 15:57, Rob Herring wrote:
> On 07/05/2012 09:32 AM, Lee Jones wrote:
>> Sometimes it doesn't make any sense for a node to have an address.
>> In this case device lookup will always be unsuccessful because we
>> currently assume every node will have a reg property. This patch
>> changes the semantics so that the resource address and the lookup
>> address will only be compared if one exists.
>>
>> Things like AUXDATA() rely on of_dev_lookup to return the lookup
>> entry of a particular device in order to do things like apply
>> platform_data to a device. However, this is currently broken for
>> nodes which do not have a reg property, meaning that platform_data
>> can not be passed in those cases.
>>
>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>> ---
>
> Acked-by: Rob Herring <rob.herring@calxeda.com>
>
> Do you have something dependent on this or want me to apply?

I have things that require this patch yes. Please apply.

Thanks Rob.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog



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

* [PATCH] of: address: Don't fail a lookup just because a node has no reg property
@ 2012-07-05 15:17     ` Lee Jones
  0 siblings, 0 replies; 13+ messages in thread
From: Lee Jones @ 2012-07-05 15:17 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/07/12 15:57, Rob Herring wrote:
> On 07/05/2012 09:32 AM, Lee Jones wrote:
>> Sometimes it doesn't make any sense for a node to have an address.
>> In this case device lookup will always be unsuccessful because we
>> currently assume every node will have a reg property. This patch
>> changes the semantics so that the resource address and the lookup
>> address will only be compared if one exists.
>>
>> Things like AUXDATA() rely on of_dev_lookup to return the lookup
>> entry of a particular device in order to do things like apply
>> platform_data to a device. However, this is currently broken for
>> nodes which do not have a reg property, meaning that platform_data
>> can not be passed in those cases.
>>
>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>> ---
>
> Acked-by: Rob Herring <rob.herring@calxeda.com>
>
> Do you have something dependent on this or want me to apply?

I have things that require this patch yes. Please apply.

Thanks Rob.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] of: address: Don't fail a lookup just because a node has no reg property
@ 2012-07-05 15:38       ` Arnd Bergmann
  0 siblings, 0 replies; 13+ messages in thread
From: Arnd Bergmann @ 2012-07-05 15:38 UTC (permalink / raw)
  To: Lee Jones
  Cc: Rob Herring, linux-arm-kernel, linux-kernel, linus.walleij,
	devicetree-discuss, rob.herring, grant.likely,
	STEricsson_nomadik_linux

On Thursday 05 July 2012, Lee Jones wrote:
> >
> > Acked-by: Rob Herring <rob.herring@calxeda.com>
> >
> > Do you have something dependent on this or want me to apply?
> 
> I have things that require this patch yes. Please apply.

I guess Rob's question was whether you want to keep this together
with the patch that depends on it rather than him applying just
the one patch.

	Arnd

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

* Re: [PATCH] of: address: Don't fail a lookup just because a node has no reg property
@ 2012-07-05 15:38       ` Arnd Bergmann
  0 siblings, 0 replies; 13+ messages in thread
From: Arnd Bergmann @ 2012-07-05 15:38 UTC (permalink / raw)
  To: Lee Jones
  Cc: linus.walleij-0IS4wlFg1OjSUeElwK9/Pw,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	STEricsson_nomadik_linux-nkJGhpqTU55BDgjK7y7TUQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thursday 05 July 2012, Lee Jones wrote:
> >
> > Acked-by: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
> >
> > Do you have something dependent on this or want me to apply?
> 
> I have things that require this patch yes. Please apply.

I guess Rob's question was whether you want to keep this together
with the patch that depends on it rather than him applying just
the one patch.

	Arnd

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

* [PATCH] of: address: Don't fail a lookup just because a node has no reg property
@ 2012-07-05 15:38       ` Arnd Bergmann
  0 siblings, 0 replies; 13+ messages in thread
From: Arnd Bergmann @ 2012-07-05 15:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 05 July 2012, Lee Jones wrote:
> >
> > Acked-by: Rob Herring <rob.herring@calxeda.com>
> >
> > Do you have something dependent on this or want me to apply?
> 
> I have things that require this patch yes. Please apply.

I guess Rob's question was whether you want to keep this together
with the patch that depends on it rather than him applying just
the one patch.

	Arnd

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

* Re: [PATCH] of: address: Don't fail a lookup just because a node has no reg property
  2012-07-05 15:38       ` Arnd Bergmann
@ 2012-07-05 15:50         ` Lee Jones
  -1 siblings, 0 replies; 13+ messages in thread
From: Lee Jones @ 2012-07-05 15:50 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Rob Herring, linux-arm-kernel, linux-kernel, linus.walleij,
	devicetree-discuss, rob.herring, grant.likely,
	STEricsson_nomadik_linux

On 05/07/12 16:38, Arnd Bergmann wrote:
> On Thursday 05 July 2012, Lee Jones wrote:
>>>
>>> Acked-by: Rob Herring <rob.herring@calxeda.com>
>>>
>>> Do you have something dependent on this or want me to apply?
>>
>> I have things that require this patch yes. Please apply.
>
> I guess Rob's question was whether you want to keep this together
> with the patch that depends on it rather than him applying just
> the one patch.

No, it's not important.

I'll send you the other patch as part of my DT pull-request.

I'm just waiting on Linus' Ack on a few patches and it'll be ready.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog



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

* [PATCH] of: address: Don't fail a lookup just because a node has no reg property
@ 2012-07-05 15:50         ` Lee Jones
  0 siblings, 0 replies; 13+ messages in thread
From: Lee Jones @ 2012-07-05 15:50 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/07/12 16:38, Arnd Bergmann wrote:
> On Thursday 05 July 2012, Lee Jones wrote:
>>>
>>> Acked-by: Rob Herring <rob.herring@calxeda.com>
>>>
>>> Do you have something dependent on this or want me to apply?
>>
>> I have things that require this patch yes. Please apply.
>
> I guess Rob's question was whether you want to keep this together
> with the patch that depends on it rather than him applying just
> the one patch.

No, it's not important.

I'll send you the other patch as part of my DT pull-request.

I'm just waiting on Linus' Ack on a few patches and it'll be ready.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2012-07-05 15:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-05 14:32 [PATCH] of: address: Don't fail a lookup just because a node has no reg property Lee Jones
2012-07-05 14:32 ` Lee Jones
2012-07-05 14:38 ` Linus Walleij
2012-07-05 14:38   ` Linus Walleij
2012-07-05 14:57 ` Rob Herring
2012-07-05 14:57   ` Rob Herring
2012-07-05 15:17   ` Lee Jones
2012-07-05 15:17     ` Lee Jones
2012-07-05 15:38     ` Arnd Bergmann
2012-07-05 15:38       ` Arnd Bergmann
2012-07-05 15:38       ` Arnd Bergmann
2012-07-05 15:50       ` Lee Jones
2012-07-05 15:50         ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.