aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2019-10-17 09:40:06 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-26 20:42:32 +0200
commit20ed2d1608ecc389ec3df87fc228a7d487f8b07b (patch)
tree56c507216bfea0c9c2a86f37c7cf4f09eaf97549 /drivers/staging/wfx
parentstaging: wfx: fix Oops when CONFIG_OF_NET is not set (diff)
downloadlinux-dev-20ed2d1608ecc389ec3df87fc228a7d487f8b07b.tar.xz
linux-dev-20ed2d1608ecc389ec3df87fc228a7d487f8b07b.zip
staging: wfx: fix setting MAC address from DT
MAC address read from chip is unconditionally used even if a MAC address is configured in device tree. Reported-by: Marc Dorval <marc.dorval@silabs.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191017093954.657-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx')
-rw-r--r--drivers/staging/wfx/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 205b5bc8872e..18f07f7ad347 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -410,8 +410,9 @@ int wfx_probe(struct wfx_dev *wdev)
if (!IS_ERR_OR_NULL(macaddr)) {
ether_addr_copy(wdev->addresses[i].addr, macaddr);
wdev->addresses[i].addr[ETH_ALEN - 1] += i;
+ } else {
+ ether_addr_copy(wdev->addresses[i].addr, wdev->hw_caps.mac_addr[i]);
}
- ether_addr_copy(wdev->addresses[i].addr, wdev->hw_caps.mac_addr[i]);
if (!is_valid_ether_addr(wdev->addresses[i].addr)) {
dev_warn(wdev->dev, "using random MAC address\n");
eth_random_addr(wdev->addresses[i].addr);