staging: rtl8723au: Fold some resource allocation abstraction into their callers
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 15 Apr 2014 17:44:42 +0000 (19:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2014 18:04:08 +0000 (11:04 -0700)
Fold rtw_os_recvbuf_resource_alloc23a() and
rtw_os_recvbuf_resource_free23a() into the functions calling them.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/hal/rtl8723au_recv.c
drivers/staging/rtl8723au/include/recv_osdep.h
drivers/staging/rtl8723au/os_dep/recv_linux.c

index a7568bb65e2a367ce0ed985f3b6c3e84626eec36..e1f17af78a1226d4c3f3323137aad542c07a7174 100644 (file)
@@ -65,8 +65,8 @@ int rtl8723au_init_recv_priv(struct rtw_adapter *padapter)
        for (i = 0; i < NR_RECVBUFF; i++) {
                INIT_LIST_HEAD(&precvbuf->list);
 
-               res = rtw_os_recvbuf_resource_alloc23a(padapter, precvbuf);
-               if (res == _FAIL)
+               precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
+               if (!precvbuf->purb)
                        break;
 
                precvbuf->adapter = padapter;
@@ -109,7 +109,11 @@ void rtl8723au_free_recv_priv(struct rtw_adapter *padapter)
        precvbuf = (struct recv_buf *)precvpriv->precv_buf;
 
        for (i = 0; i < NR_RECVBUFF; i++) {
-               rtw_os_recvbuf_resource_free23a(padapter, precvbuf);
+               usb_free_urb(precvbuf->purb);
+
+               if (precvbuf->pskb)
+                       dev_kfree_skb_any(precvbuf->pskb);
+
                precvbuf++;
        }
 
index 39809befb88cd6bf58dff5cba913776b17f67d33..3a2cd8a3058d6b8f224ec9de135a0e2705434e23 100644 (file)
@@ -33,9 +33,6 @@ void rtw_free_recv_priv (struct recv_priv *precvpriv);
 
 int rtw_os_recv_resource_init(struct recv_priv *precvpriv, struct rtw_adapter *padapter);
 
-int rtw_os_recvbuf_resource_alloc23a(struct rtw_adapter *padapter, struct recv_buf *precvbuf);
-int rtw_os_recvbuf_resource_free23a(struct rtw_adapter *padapter, struct recv_buf *precvbuf);
-
 void rtw_init_recv_timer23a(struct recv_reorder_ctrl *preorder_ctrl);
 
 #endif
index 321aa282e3f25012db09da57df8b379e9d7d42d5..8fecbe38ca274da2f1b6afe700e5b3e113d8cf9e 100644 (file)
 
 #include <usb_ops.h>
 
-/* alloc os related resource in struct recv_buf */
-int rtw_os_recvbuf_resource_alloc23a(struct rtw_adapter *padapter,
-                                 struct recv_buf *precvbuf)
-{
-       int res = _SUCCESS;
-
-       precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
-       if (precvbuf->purb == NULL)
-               res = _FAIL;
-
-       precvbuf->pskb = NULL;
-
-       return res;
-}
-
-/* free os related resource in struct recv_buf */
-int rtw_os_recvbuf_resource_free23a(struct rtw_adapter *padapter,
-                                struct recv_buf *precvbuf)
-{
-       int ret = _SUCCESS;
-
-       usb_free_urb(precvbuf->purb);
-
-       if (precvbuf->pskb)
-               dev_kfree_skb_any(precvbuf->pskb);
-
-       return ret;
-}
-
 void rtw_handle_tkip_mic_err23a(struct rtw_adapter *padapter, u8 bgroup)
 {
        enum nl80211_key_type key_type = 0;