From: navin patidar Date: Thu, 10 Jul 2014 03:42:17 +0000 (+0530) Subject: staging: rtl8188eu: Remove function rtw_alloc_etherdev() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=0fb7778790811d1d838e57891ba320a0011e8ff6;p=deliverable%2Flinux.git staging: rtl8188eu: Remove function rtw_alloc_etherdev() rtw_alloc_etherdev() is used in rtw_init_netdev() but never gets called because old_padapter is never NULL. Signed-off-by: navin patidar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h index 95131fe5c2b5..a52dcd56229b 100644 --- a/drivers/staging/rtl8188eu/include/osdep_service.h +++ b/drivers/staging/rtl8188eu/include/osdep_service.h @@ -164,7 +164,6 @@ struct rtw_netdev_priv_indicator { }; struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv); -struct net_device *rtw_alloc_etherdev(int sizeof_priv); #define rtw_netdev_priv(netdev) \ (((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))->priv) diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index b0c38a45fbf7..c7a44ab33d64 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -707,14 +707,12 @@ static const struct device_type wlan_type = { struct net_device *rtw_init_netdev(struct adapter *old_padapter) { struct adapter *padapter; - struct net_device *pnetdev; + struct net_device *pnetdev = NULL; RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+init_net_dev\n")); if (old_padapter != NULL) pnetdev = rtw_alloc_etherdev_with_old_priv(sizeof(struct adapter), (void *)old_padapter); - else - pnetdev = rtw_alloc_etherdev(sizeof(struct adapter)); if (!pnetdev) return NULL; diff --git a/drivers/staging/rtl8188eu/os_dep/osdep_service.c b/drivers/staging/rtl8188eu/os_dep/osdep_service.c index 76eddcdb6ad1..93c76d7e8181 100644 --- a/drivers/staging/rtl8188eu/os_dep/osdep_service.c +++ b/drivers/staging/rtl8188eu/os_dep/osdep_service.c @@ -111,29 +111,6 @@ RETURN: return pnetdev; } -struct net_device *rtw_alloc_etherdev(int sizeof_priv) -{ - struct net_device *pnetdev; - struct rtw_netdev_priv_indicator *pnpi; - - pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4); - if (!pnetdev) - goto RETURN; - - pnpi = netdev_priv(pnetdev); - - pnpi->priv = vzalloc(sizeof_priv); - if (!pnpi->priv) { - free_netdev(pnetdev); - pnetdev = NULL; - goto RETURN; - } - - pnpi->sizeof_priv = sizeof_priv; -RETURN: - return pnetdev; -} - void rtw_free_netdev(struct net_device *netdev) { struct rtw_netdev_priv_indicator *pnpi;