From: Hui Wang Date: Thu, 28 Jun 2012 08:21:34 +0000 (+0800) Subject: can: flexcan: use of_property_read_u32 to get DT entry value X-Git-Tag: upstream/snapshot3+hdmi~6997^2~269^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=afc016d8360ceb19a1f37bf6579d5850d47d582d;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git can: flexcan: use of_property_read_u32 to get DT entry value 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. Cc: linux-can@vger.kernel.org Cc: Marc Kleine-Budde Cc: Wolfgang Grandegger Cc: Shawn Guo Signed-off-by: Hui Wang Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 0f88cd3..b429b3f 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);