aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bmips
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/bmips')
-rw-r--r--target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c6
-rw-r--r--target/linux/bmips/files/arch/mips/bmips/b43-sprom.c6
-rw-r--r--target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c6
3 files changed, 6 insertions, 12 deletions
diff --git a/target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c b/target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c
index dd13ac6256..fc03416507 100644
--- a/target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c
+++ b/target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c
@@ -167,7 +167,6 @@ static int ath9k_fixup_probe(struct platform_device *pdev)
struct device_node *node = dev->of_node;
struct ath9k_fixup *priv;
struct resource *res;
- const void *mac;
int ret;
if (ath9k_num_fixups >= ATH9K_MAX_FIXUPS)
@@ -200,9 +199,8 @@ static int ath9k_fixup_probe(struct platform_device *pdev)
priv->pdata.led_active_high = of_property_read_bool(node,
"ath,led-active-high");
- mac = of_get_mac_address(node);
- if (!IS_ERR_OR_NULL(mac)) {
- memcpy(priv->mac, mac, ETH_ALEN);
+ of_get_mac_address(node, priv->mac);
+ if (is_valid_ether_addr(priv->mac)) {
dev_info(dev, "mtd mac %pM\n", priv->mac);
} else {
random_ether_addr(priv->mac);
diff --git a/target/linux/bmips/files/arch/mips/bmips/b43-sprom.c b/target/linux/bmips/files/arch/mips/bmips/b43-sprom.c
index 2348bd1fe2..edc7fb145b 100644
--- a/target/linux/bmips/files/arch/mips/bmips/b43-sprom.c
+++ b/target/linux/bmips/files/arch/mips/bmips/b43-sprom.c
@@ -1119,7 +1119,6 @@ static int b43_sprom_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *node = dev->of_node;
struct b43_sprom *priv = &b43_sprom;
- const void *mac;
int ret;
priv->dev = dev;
@@ -1129,9 +1128,8 @@ static int b43_sprom_probe(struct platform_device *pdev)
of_property_read_u32(node, "pci-bus", &priv->pci_bus);
of_property_read_u32(node, "pci-dev", &priv->pci_dev);
- mac = of_get_mac_address(node);
- if (!IS_ERR_OR_NULL(mac)) {
- memcpy(priv->mac, mac, ETH_ALEN);
+ of_get_mac_address(node, priv->mac);
+ if (is_valid_ether_addr(priv->mac)) {
dev_info(dev, "mtd mac %pM\n", priv->mac);
} else {
random_ether_addr(priv->mac);
diff --git a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c
index 2a27118aa7..d9ecba5188 100644
--- a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c
+++ b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c
@@ -864,7 +864,6 @@ static int bcm6368_enetsw_probe(struct platform_device *pdev)
struct device_node *node = dev->of_node;
struct net_device *ndev;
struct resource *res;
- const void *mac;
unsigned i;
int ret;
@@ -953,9 +952,8 @@ static int bcm6368_enetsw_probe(struct platform_device *pdev)
priv->dma_chan_int_mask = DMAC_IR_PKTDONE_MASK;
priv->dma_chan_width = DMA_CHAN_WIDTH;
- mac = of_get_mac_address(node);
- if (!IS_ERR_OR_NULL(mac)) {
- memcpy(ndev->dev_addr, mac, ETH_ALEN);
+ of_get_mac_address(node, ndev->dev_addr);
+ if (is_valid_ether_addr(ndev->dev_addr)) {
dev_info(dev, "mtd mac %pM\n", ndev->dev_addr);
} else {
random_ether_addr(ndev->dev_addr);