diff options
author | David S. Miller <davem@davemloft.net> | 2019-05-07 12:22:47 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-07 12:22:47 -0700 |
commit | 2e7ae67b5fbbe596cb3e06410970945f975a241a (patch) | |
tree | fc9af6d5d1fbcaa88b0eb60e543da7cec1acd12b /net | |
parent | 8e8673a227084923f5b3bb80a68e741aac77948d (diff) | |
parent | a51645f70f6384ae3329551750f7f502cb8de5fc (diff) |
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 'net')
-rw-r--r-- | net/dsa/slave.c | 2 | ||||
-rw-r--r-- | net/ethernet/eth.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 316bce9e0fbf..fe7b6a62e8f1 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1418,7 +1418,7 @@ int dsa_slave_create(struct dsa_port *port) NETIF_F_HW_VLAN_CTAG_FILTER; slave_dev->hw_features |= NETIF_F_HW_TC; slave_dev->ethtool_ops = &dsa_slave_ethtool_ops; - if (port->mac && is_valid_ether_addr(port->mac)) + if (!IS_ERR_OR_NULL(port->mac)) ether_addr_copy(slave_dev->dev_addr, port->mac); else eth_hw_addr_inherit(slave_dev, master); diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index fddcee38c1da..4b2b222377ac 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -560,7 +560,7 @@ int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr) addr = NULL; if (dp) addr = of_get_mac_address(dp); - if (!addr) + if (IS_ERR_OR_NULL(addr)) addr = arch_get_platform_mac_address(); if (!addr) |