mirror of
https://github.com/amazingfate/rtl8723ds.git
synced 2025-10-13 12:26:02 +01:00
rtl8723ds: simplify locking in rtw_change_ifname()
As the comment says, rtnl_lock is acquired by the caller of this function. In fact this is not specific to 2.6.26 and later but has always been the case, so checking lock state is unnecessary and we can just call (un)register_netdevice() knowing that rtnl_lock is held.
This commit is contained in:
parent
1eca486544
commit
dac75d70bc
@ -1516,10 +1516,6 @@ RETURN:
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Jeff: this function should be called under ioctl (rtnl_lock is accquired) while
|
||||
* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
|
||||
*/
|
||||
int rtw_change_ifname(_adapter *padapter, const char *ifname)
|
||||
{
|
||||
struct net_device *pnetdev;
|
||||
@ -1539,12 +1535,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
|
||||
rereg_priv->old_pnetdev = NULL;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
|
||||
if (!rtnl_is_locked())
|
||||
unregister_netdev(cur_pnetdev);
|
||||
else
|
||||
#endif
|
||||
unregister_netdevice(cur_pnetdev);
|
||||
unregister_netdevice(cur_pnetdev);
|
||||
|
||||
rereg_priv->old_pnetdev = cur_pnetdev;
|
||||
|
||||
@ -1564,12 +1555,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
|
||||
dev_addr_set(pnetdev, adapter_mac_addr(padapter));
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
|
||||
if (!rtnl_is_locked())
|
||||
ret = register_netdev(pnetdev);
|
||||
else
|
||||
#endif
|
||||
ret = register_netdevice(pnetdev);
|
||||
ret = register_netdevice(pnetdev);
|
||||
|
||||
if (ret != 0) {
|
||||
goto error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user