All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Hui Wang <jason77.wang@gmail.com>
Cc: davem@davemloft.net, shawn.guo@linaro.org, linux-can@vger.kernel.org
Subject: Re: [PATCH 1/4] can: flexcan: use be32_to_cpup to handle the value of dt entry
Date: Wed, 27 Jun 2012 10:38:33 +0200	[thread overview]
Message-ID: <4FEAC689.3030902@pengutronix.de> (raw)
In-Reply-To: <1340785161-3598-2-git-send-email-jason77.wang@gmail.com>

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

On 06/27/2012 10:19 AM, Hui Wang wrote:
> 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.

good catch. We didn't notice since this clock has only been used on
powerpc so far. However you should not need to set this property, as ARM
has proper clock tree support and the clock rate is taken from the clock
tree not the device tree.

Applied to can-master.

Marc

> Cc: linux-can@vger.kernel.org
> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Signed-off-by: Hui Wang <jason77.wang@gmail.com>
> ---
>  drivers/net/can/flexcan.c |    4 ++--
>  1 files 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) {


-- 
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 --]

  parent reply	other threads:[~2012-06-27  8:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27  8:19 [PATCH 0/4] can: flexcan: upgrade the flexcan.c to support i.MX6 Hui Wang
2012-06-27  8:19 ` [PATCH 1/4] can: flexcan: use be32_to_cpup to handle the value of dt entry Hui Wang
2012-06-27  8:19   ` [PATCH 2/4] can: flexcan: add hardware controller version support Hui Wang
2012-06-27  8:19     ` [PATCH 3/4] can: flexcan: add ipg and ser clocks support Hui Wang
2012-06-27  8:19       ` [PATCH 4/4] can: flexcan: add transceiver switch support when use device tree Hui Wang
2012-06-27  8:26         ` Marc Kleine-Budde
2012-06-27  9:55           ` Hui Wang
2012-06-27 10:02             ` Marc Kleine-Budde
2012-06-27 11:22             ` Shawn Guo
2012-06-27 11:46               ` Marc Kleine-Budde
2012-06-28  1:53               ` Hui Wang
2012-06-27  8:45       ` [PATCH 3/4] can: flexcan: add ipg and ser clocks support Marc Kleine-Budde
2012-06-27  8:27     ` [PATCH 2/4] can: flexcan: add hardware controller version support Marc Kleine-Budde
2012-06-27  8:56       ` Wolfgang Grandegger
2012-06-27  9:43         ` Wolfgang Grandegger
2012-06-27  9:51           ` Marc Kleine-Budde
2012-06-27 10:13             ` Hui Wang
2012-06-27 10:24               ` Marc Kleine-Budde
2012-06-27 10:57               ` Wolfgang Grandegger
2012-06-27  8:38   ` Marc Kleine-Budde [this message]
2012-06-27  9:07   ` [PATCH 1/4] can: flexcan: use be32_to_cpup to handle the value of dt entry Wolfgang Grandegger

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=4FEAC689.3030902@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=jason77.wang@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=shawn.guo@linaro.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 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.