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>
This commit is contained in:
Jérôme Pouiller 2019-10-17 09:40:06 +00:00 committed by Greg Kroah-Hartman
parent 4e4f5e6fef
commit 20ed2d1608

View File

@ -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);