All of lore.kernel.org
 help / color / mirror / Atom feed
* pull-request: can 2012-06-27
@ 2012-06-27  9:27 Marc Kleine-Budde
  2012-06-27  9:27 ` [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry Marc Kleine-Budde
  2012-06-27 22:28 ` pull-request: can 2012-06-27 David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2012-06-27  9:27 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-can

Hello David,

here's a patch intended for v3.5, targeting net/master. Hui Wang has
found and fixed an endianness problem in the device tree handling in
the flexcan driver.

regards, Marc

---

The following changes since commit 6bc96d047fe32d76ef79f3195c52a542edf7c705:

  xen/netfront: teardown the device before unregistering it. (2012-06-27 01:25:41 -0700)

are available in the git repository at:

  git://gitorious.org/linux-can/linux-can.git for-davem

for you to fetch changes up to 85f2f834e85517307f13e30e630a5fc86f757cb5:

  can: flexcan: use be32_to_cpup to handle the value of dt entry (2012-06-27 11:12:07 +0200)

----------------------------------------------------------------
Hui Wang (1):
      can: flexcan: use be32_to_cpup to handle the value of dt entry

 drivers/net/can/flexcan.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

* [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry
  2012-06-27  9:27 pull-request: can 2012-06-27 Marc Kleine-Budde
@ 2012-06-27  9:27 ` Marc Kleine-Budde
  2012-06-27 11:26   ` Shawn Guo
  2012-06-27 22:28 ` pull-request: can 2012-06-27 David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Marc Kleine-Budde @ 2012-06-27  9:27 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-can, Hui Wang, Shawn Guo, Marc Kleine-Budde

From: Hui Wang <jason77.wang@gmail.com>

The freescale arm i.MX series platform can support this driver, and
usually the arm cpu works in the little endian mode by default, while
device tree entry value is stored in big endian format, we should use
be32_to_cpup() to handle them, after modification, it can work well
both on the le cpu and be cpu.

Cc: stable <stable@vger.kernel.org> # v3.2+
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Hui Wang <jason77.wang@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/flexcan.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 38c0690..81d4741 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -939,12 +939,12 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
 		return PTR_ERR(pinctrl);
 
 	if (pdev->dev.of_node) {
-		const u32 *clock_freq_p;
+		const __be32 *clock_freq_p;
 
 		clock_freq_p = of_get_property(pdev->dev.of_node,
 						"clock-frequency", NULL);
 		if (clock_freq_p)
-			clock_freq = *clock_freq_p;
+			clock_freq = be32_to_cpup(clock_freq_p);
 	}
 
 	if (!clock_freq) {
-- 
1.7.10

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

* Re: [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry
  2012-06-27  9:27 ` [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry Marc Kleine-Budde
@ 2012-06-27 11:26   ` Shawn Guo
  2012-06-27 11:34     ` Marc Kleine-Budde
  0 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2012-06-27 11:26 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: davem, netdev, linux-can, Hui Wang

On 27 June 2012 17:27, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> From: Hui Wang <jason77.wang@gmail.com>
>
> The freescale arm i.MX series platform can support this driver, and
> usually the arm cpu works in the little endian mode by default, while
> device tree entry value is stored in big endian format, we should use
> be32_to_cpup() to handle them, after modification, it can work well
> both on the le cpu and be cpu.
>
I'm wondering if you want to just use of_property_read_u32() to make
it a little bit easier.

Regards,
Shawn

> Cc: stable <stable@vger.kernel.org> # v3.2+
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Signed-off-by: Hui Wang <jason77.wang@gmail.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>  drivers/net/can/flexcan.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index 38c0690..81d4741 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -939,12 +939,12 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
>                return PTR_ERR(pinctrl);
>
>        if (pdev->dev.of_node) {
> -               const u32 *clock_freq_p;
> +               const __be32 *clock_freq_p;
>
>                clock_freq_p = of_get_property(pdev->dev.of_node,
>                                                "clock-frequency", NULL);
>                if (clock_freq_p)
> -                       clock_freq = *clock_freq_p;
> +                       clock_freq = be32_to_cpup(clock_freq_p);
>        }
>
>        if (!clock_freq) {
> --
> 1.7.10
>

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

* Re: [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry
  2012-06-27 11:26   ` Shawn Guo
@ 2012-06-27 11:34     ` Marc Kleine-Budde
  2012-06-28  1:54         ` Hui Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Marc Kleine-Budde @ 2012-06-27 11:34 UTC (permalink / raw)
  To: Shawn Guo; +Cc: davem, netdev, linux-can, Hui Wang

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

On 06/27/2012 01:26 PM, Shawn Guo wrote:
> On 27 June 2012 17:27, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>> From: Hui Wang <jason77.wang@gmail.com>
>>
>> The freescale arm i.MX series platform can support this driver, and
>> usually the arm cpu works in the little endian mode by default, while
>> device tree entry value is stored in big endian format, we should use
>> be32_to_cpup() to handle them, after modification, it can work well
>> both on the le cpu and be cpu.
>>
> I'm wondering if you want to just use of_property_read_u32() to make
> it a little bit easier.

Even better. Hui can you send a updated patch.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

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

* Re: pull-request: can 2012-06-27
  2012-06-27  9:27 pull-request: can 2012-06-27 Marc Kleine-Budde
  2012-06-27  9:27 ` [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry Marc Kleine-Budde
@ 2012-06-27 22:28 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2012-06-27 22:28 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Wed, 27 Jun 2012 11:27:15 +0200

> here's a patch intended for v3.5, targeting net/master. Hui Wang has
> found and fixed an endianness problem in the device tree handling in
> the flexcan driver.

Pulled, thanks Marc.

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

* Re: [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry
  2012-06-27 11:34     ` Marc Kleine-Budde
@ 2012-06-28  1:54         ` Hui Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Hui Wang @ 2012-06-28  1:54 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: Shawn Guo, davem, netdev, linux-can, Hui Wang

Marc Kleine-Budde wrote:
> On 06/27/2012 01:26 PM, Shawn Guo wrote:
>   
>> On 27 June 2012 17:27, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>>     
>>> From: Hui Wang <jason77.wang@gmail.com>
>>>
>>> The freescale arm i.MX series platform can support this driver, and
>>> usually the arm cpu works in the little endian mode by default, while
>>> device tree entry value is stored in big endian format, we should use
>>> be32_to_cpup() to handle them, after modification, it can work well
>>> both on the le cpu and be cpu.
>>>
>>>       
>> I'm wondering if you want to just use of_property_read_u32() to make
>> it a little bit easier.
>>     
>
> Even better. Hui can you send a updated patch.
>   
OK.

Regards,
Hui.
> Marc
>
>   


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

* Re: [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry
@ 2012-06-28  1:54         ` Hui Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Hui Wang @ 2012-06-28  1:54 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: Shawn Guo, davem, netdev, linux-can, Hui Wang

Marc Kleine-Budde wrote:
> On 06/27/2012 01:26 PM, Shawn Guo wrote:
>   
>> On 27 June 2012 17:27, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>>     
>>> From: Hui Wang <jason77.wang@gmail.com>
>>>
>>> The freescale arm i.MX series platform can support this driver, and
>>> usually the arm cpu works in the little endian mode by default, while
>>> device tree entry value is stored in big endian format, we should use
>>> be32_to_cpup() to handle them, after modification, it can work well
>>> both on the le cpu and be cpu.
>>>
>>>       
>> I'm wondering if you want to just use of_property_read_u32() to make
>> it a little bit easier.
>>     
>
> Even better. Hui can you send a updated patch.
>   
OK.

Regards,
Hui.
> Marc
>
>   


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

end of thread, other threads:[~2012-06-28  1:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27  9:27 pull-request: can 2012-06-27 Marc Kleine-Budde
2012-06-27  9:27 ` [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry Marc Kleine-Budde
2012-06-27 11:26   ` Shawn Guo
2012-06-27 11:34     ` Marc Kleine-Budde
2012-06-28  1:54       ` Hui Wang
2012-06-28  1:54         ` Hui Wang
2012-06-27 22:28 ` pull-request: can 2012-06-27 David Miller

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.