Skip to content

Commit

Permalink
can: flexcan: use be32_to_cpup to handle the value of dt entry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hui Wang authored and Marc Kleine-Budde committed Jun 27, 2012
1 parent 6bc96d0 commit 85f2f83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/can/flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 85f2f83

Please sign in to comment.