From 8377e32e0b51255bfe117abbd737da1e2d20769a Mon Sep 17 00:00:00 2001 From: Marian-Cristian Rotariu Date: Tue, 3 Mar 2015 16:36:05 +0200 Subject: dpaa_eth: fix endianness issue in the dts parser The phandle value in the dtb is a BE value and will not be properly parsed on a LE architecture. This patch adds the proper device tree parser API call that has the conversion to a proper architecture integrated in its implementation. Change-Id: I2c462acaf0801bb47a2179e02fc9c8d610a6f0ff Signed-off-by: Marian-Cristian Rotariu Reviewed-on: http://git.am.freescale.net:8181/25779 Reviewed-on: http://git.am.freescale.net:8181/32503 Reviewed-by: Madalin-Cristian Bucur diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c index eae02e1..6cb2ae1 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c @@ -549,7 +549,6 @@ dpa_mac_probe(struct platform_device *_of_dev) struct device *dpa_dev, *dev; struct device_node *mac_node; int lenp; - const phandle *phandle_prop; struct platform_device *of_dev; struct mac_device *mac_dev; #ifdef CONFIG_FSL_DPAA_1588 @@ -558,18 +557,11 @@ dpa_mac_probe(struct platform_device *_of_dev) struct device_node *timer_node; #endif - phandle_prop = of_get_property(_of_dev->dev.of_node, - "fsl,fman-mac", &lenp); - if (phandle_prop == NULL) - return NULL; - - BUG_ON(lenp != sizeof(phandle)); - dpa_dev = &_of_dev->dev; - mac_node = of_find_node_by_phandle(*phandle_prop); + mac_node = of_parse_phandle(_of_dev->dev.of_node, "fsl,fman-mac", 0); if (unlikely(mac_node == NULL)) { - dev_err(dpa_dev, "of_find_node_by_phandle() failed\n"); + dev_err(dpa_dev, "Cannot find MAC device device tree node\n"); return ERR_PTR(-EFAULT); } -- cgit v0.10.2