summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-05-07 12:22:47 -0700
committerDavid S. Miller <davem@davemloft.net>2019-05-07 12:22:47 -0700
commit2e7ae67b5fbbe596cb3e06410970945f975a241a (patch)
treefc9af6d5d1fbcaa88b0eb60e543da7cec1acd12b /drivers/net/ethernet/marvell
parent8e8673a227084923f5b3bb80a68e741aac77948d (diff)
parenta51645f70f6384ae3329551750f7f502cb8de5fc (diff)
downloadlinux-2e7ae67b5fbbe596cb3e06410970945f975a241a.tar.bz2
Merge branch 'of_get_mac_address-ERR_PTR-fixes'
Petr Štetiar says: ==================== of_get_mac_address ERR_PTR fixes this patch series is an attempt to fix the mess, I've somehow managed to introduce. First patch in this series is defacto v5 of the previous 05/10 patch in the series, but since the v4 of this 05/10 patch wasn't picked up by the patchwork for some unknown reason, this patch wasn't applied with the other 9 patches in the series, so I'm resending it as a separate patch of this fixup series again. Second patch is a result of this rebase against net-next tree, where I was checking again all current users of of_get_mac_address and found out, that there's new one in DSA, so I've converted this user to the new ERR_PTR encoded error value as well. Third patch which was sent as v5 wasn't considered for merge, but I still think, that we need to check for possible NULL value, thus current IS_ERR check isn't sufficient and we need to use IS_ERR_OR_NULL instead. Fourth patch fixes warning reported by kbuild test robot. ==================== Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Leonard Crestez <leonard.crestez@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell')
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c2
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c2
-rw-r--r--drivers/net/ethernet/marvell/pxa168_eth.c2
-rw-r--r--drivers/net/ethernet/marvell/sky2.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 292a668ce88e..07e254fc96ef 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2749,7 +2749,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
}
mac_addr = of_get_mac_address(pnp);
- if (mac_addr)
+ if (!IS_ERR(mac_addr))
memcpy(ppd.mac_addr, mac_addr, ETH_ALEN);
mv643xx_eth_property(pnp, "tx-queue-size", ppd.tx_queue_size);
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index a715277ecf81..8186135883ed 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4563,7 +4563,7 @@ static int mvneta_probe(struct platform_device *pdev)
}
dt_mac_addr = of_get_mac_address(dn);
- if (dt_mac_addr) {
+ if (!IS_ERR(dt_mac_addr)) {
mac_from = "device tree";
memcpy(dev->dev_addr, dt_mac_addr, ETH_ALEN);
} else {
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 35f2142aac5e..ce037e8530fa 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1461,7 +1461,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
if (pdev->dev.of_node)
mac_addr = of_get_mac_address(pdev->dev.of_node);
- if (mac_addr && is_valid_ether_addr(mac_addr)) {
+ if (!IS_ERR_OR_NULL(mac_addr)) {
ether_addr_copy(dev->dev_addr, mac_addr);
} else {
/* try reading the mac address, if set by the bootloader */
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 8b3495ee2b6e..c4050ec594f4 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -4808,7 +4808,7 @@ static struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port,
* 2) from internal registers set by bootloader
*/
iap = of_get_mac_address(hw->pdev->dev.of_node);
- if (iap)
+ if (!IS_ERR(iap))
memcpy(dev->dev_addr, iap, ETH_ALEN);
else
memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port * 8,