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: wg@grandegger.com, shawn.guo@linaro.org, linux-can@vger.kernel.org
Subject: Re: [PATCH v2 1/2] can: flexcan: use of_property_read_u32 to get DT entry value
Date: Thu, 28 Jun 2012 12:22:48 +0200	[thread overview]
Message-ID: <4FEC3078.2090706@pengutronix.de> (raw)
In-Reply-To: <1340871695-26327-2-git-send-email-jason77.wang@gmail.com>

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

On 06/28/2012 10:21 AM, Hui Wang wrote:
> of_property_read_u32() can auto handle endian problems, use this
> function can make code clean and simple.
> 
> No need to check return value here since the following got value
> check will handle this.

Should this go to v3.5 or to net-next? If it goes via net-next, I have
to delay it until David merges net (which has the be32_to_cpup fix).

Marc

> 
> Cc: linux-can@vger.kernel.org
> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
> Cc: Wolfgang Grandegger <wg@grandegger.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Signed-off-by: Hui Wang <jason77.wang@gmail.com>
> ---
>  drivers/net/can/flexcan.c |   11 +++--------
>  1 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index 81d4741..f63f826 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -938,14 +938,9 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
>  	if (IS_ERR(pinctrl))
>  		return PTR_ERR(pinctrl);
>  
> -	if (pdev->dev.of_node) {
> -		const __be32 *clock_freq_p;
> -
> -		clock_freq_p = of_get_property(pdev->dev.of_node,
> -						"clock-frequency", NULL);
> -		if (clock_freq_p)
> -			clock_freq = be32_to_cpup(clock_freq_p);
> -	}
> +	if (pdev->dev.of_node)
> +		of_property_read_u32(pdev->dev.of_node,
> +						"clock-frequency", &clock_freq);
>  
>  	if (!clock_freq) {
>  		clk = clk_get(&pdev->dev, NULL);


-- 
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-28 10:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28  8:21 [PATCH v2 0/2] can: flexcan: upgrade the flexcan.c to support i.MX6 Hui Wang
2012-06-28  8:21 ` [PATCH v2 1/2] can: flexcan: use of_property_read_u32 to get DT entry value Hui Wang
2012-06-28  8:21   ` [PATCH v2 2/2] can: flexcan: add hardware controller version support Hui Wang
2012-06-28 10:20     ` Marc Kleine-Budde
2012-06-28 10:22   ` Marc Kleine-Budde [this message]
2012-07-02  2:33     ` [PATCH v2 1/2] can: flexcan: use of_property_read_u32 to get DT entry value Hui Wang
2012-06-30 12:29   ` Marc Kleine-Budde

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=4FEC3078.2090706@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=jason77.wang@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=wg@grandegger.com \
    /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.