Commit 20ed2d16 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

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: default avatarMarc Dorval <marc.dorval@silabs.com>
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191017093954.657-5-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4e4f5e6f
...@@ -410,8 +410,9 @@ int wfx_probe(struct wfx_dev *wdev) ...@@ -410,8 +410,9 @@ int wfx_probe(struct wfx_dev *wdev)
if (!IS_ERR_OR_NULL(macaddr)) { if (!IS_ERR_OR_NULL(macaddr)) {
ether_addr_copy(wdev->addresses[i].addr, macaddr); ether_addr_copy(wdev->addresses[i].addr, macaddr);
wdev->addresses[i].addr[ETH_ALEN - 1] += i; 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)) { if (!is_valid_ether_addr(wdev->addresses[i].addr)) {
dev_warn(wdev->dev, "using random MAC address\n"); dev_warn(wdev->dev, "using random MAC address\n");
eth_random_addr(wdev->addresses[i].addr); eth_random_addr(wdev->addresses[i].addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment