staging: r8188eu: inline rtw_init_netdev_name()

The rtw_init_netdev_name() is a small function
that is used once and does not encapsulate any logic.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20201018201132.40480-1-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ivan Safonov 2020-10-18 23:11:33 +03:00 committed by Greg Kroah-Hartman
parent 620d28440c
commit 9ab476ba00
3 changed files with 5 additions and 11 deletions

View file

@ -23,7 +23,6 @@ void rtw_cancel_all_timer(struct adapter *padapter);
int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
struct net_device *rtw_init_netdev(struct adapter *padapter);
u16 rtw_recv_select_queue(struct sk_buff *skb);

View file

@ -292,15 +292,6 @@ static const struct net_device_ops rtw_netdev_ops = {
.ndo_do_ioctl = rtw_ioctl,
};
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
{
if (dev_alloc_name(pnetdev, ifname) < 0)
RT_TRACE(_module_os_intfs_c_, _drv_err_, ("dev_alloc_name, fail!\n"));
netif_carrier_off(pnetdev);
return 0;
}
static const struct device_type wlan_type = {
.name = "wlan",
};

View file

@ -390,7 +390,11 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
pr_debug("can't get autopm:\n");
/* alloc dev name after read efuse. */
rtw_init_netdev_name(pnetdev, padapter->registrypriv.ifname);
if (dev_alloc_name(pnetdev, padapter->registrypriv.ifname) < 0)
RT_TRACE(_module_os_intfs_c_, _drv_err_, ("dev_alloc_name, fail!\n"));
netif_carrier_off(pnetdev);
rtw_macaddr_cfg(padapter->eeprompriv.mac_addr);
memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
pr_debug("MAC Address from pnetdev->dev_addr = %pM\n",