diff options
author | Marian-Cristian Rotariu <marian.rotariu@freescale.com> | 2015-03-03 14:36:05 (GMT) |
---|---|---|
committer | Madalin Bucur <madalin.bucur@freescale.com> | 2015-03-11 16:07:59 (GMT) |
commit | 8377e32e0b51255bfe117abbd737da1e2d20769a (patch) | |
tree | bbbca53932d8851616e8b1ed54be7071ab73507b /drivers/net/ethernet/freescale | |
parent | 9d039899453ec385f1b0949457800d15b25d95ee (diff) | |
download | linux-fsl-qoriq-8377e32e0b51255bfe117abbd737da1e2d20769a.tar.xz |
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 <marian.rotariu@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/25779
Reviewed-on: http://git.am.freescale.net:8181/32503
Reviewed-by: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c | 12 |
1 files changed, 2 insertions, 10 deletions
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); } |