From: Glen Lee Date: Thu, 4 Feb 2016 09:15:29 +0000 (+0900) Subject: staging: wilc1000: get mac address after setting drv handler X-Git-Tag: next-20160210~18^2~296 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=32cee9993c8bccfcf1626b1b192e4ed611a0fcfb;p=karo-tx-linux.git staging: wilc1000: get mac address after setting drv handler This patch moves wilc_get_mac_address and address memcpy function after calling wilc_set_wif_drv_handler to get selected mac address. Signed-off-by: Glen Lee Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 2fafcc47b59d..9de57aeb50d4 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1018,12 +1018,8 @@ int wilc_mac_open(struct net_device *ndev) return ret; } - wilc_get_mac_address(vif, mac_add); - PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add); - for (i = 0; i < wl->vif_num; i++) { if (ndev == wl->vif[i]->ndev) { - memcpy(wl->vif[i]->src_addr, mac_add, ETH_ALEN); if (vif->iftype == AP_MODE) { wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif), @@ -1044,6 +1040,11 @@ int wilc_mac_open(struct net_device *ndev) 1); } wilc_set_operation_mode(vif, vif->iftype); + + wilc_get_mac_address(vif, mac_add); + netdev_dbg(ndev, "Mac address: %pM\n", mac_add); + memcpy(wl->vif[i]->src_addr, mac_add, ETH_ALEN); + break; } }