summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2014-05-16 12:04:24 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-16 22:34:27 +0400
commit9385d861bddfb451145500ed1375304fa6ccec41 (patch)
treeab6cbc64ff1c431fc5dc06e580a1f5692f483112
parent02d50c22bdedec15998ca1a83141aae9b79b1022 (diff)
downloadlinux-9385d861bddfb451145500ed1375304fa6ccec41.tar.xz
staging: rtl8723au: Get rid of rtl8723au_set_hal_ops() and get rid of hal_ops.h
Since rtl8723au_set_hal_ops() is just a kmalloc(), move it to rtw_usb_if1_init() and fix the error handling to not leak memory. This also allows us to get rid of hal_ops.h Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rtl8723au/hal/hal_intf.c1
-rw-r--r--drivers/staging/rtl8723au/hal/usb_halinit.c12
-rw-r--r--drivers/staging/rtl8723au/include/usb_hal.h20
-rw-r--r--drivers/staging/rtl8723au/os_dep/usb_intf.c9
4 files changed, 5 insertions, 37 deletions
diff --git a/drivers/staging/rtl8723au/hal/hal_intf.c b/drivers/staging/rtl8723au/hal/hal_intf.c
index cc1b1eac5b89..5383e692546f 100644
--- a/drivers/staging/rtl8723au/hal/hal_intf.c
+++ b/drivers/staging/rtl8723au/hal/hal_intf.c
@@ -19,7 +19,6 @@
#include <hal_intf.h>
-#include <usb_hal.h>
#include <rtl8723a_hal.h>
void rtw_hal_update_ra_mask23a(struct sta_info *psta, u8 rssi_level)
diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 5ecd7f339f82..538eacc51ed2 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -25,7 +25,6 @@
#include <linux/ieee80211.h>
#include <usb_ops.h>
-#include <usb_hal.h>
#include <usb_osintf.h>
static void
@@ -1691,14 +1690,3 @@ int rtw_hal_deinit23a(struct rtw_adapter *padapter)
DBG_8723A("\n rtw_hal_deinit23a: hal_init fail\n");
return status;
}
-
-int rtl8723au_set_hal_ops(struct rtw_adapter *padapter)
-{
- padapter->HalData = kzalloc(sizeof(struct hal_data_8723a), GFP_KERNEL);
- if (!padapter->HalData) {
- DBG_8723A("cannot alloc memory for HAL DATA\n");
- return -ENOMEM;
- }
-
- return 0;
-}
diff --git a/drivers/staging/rtl8723au/include/usb_hal.h b/drivers/staging/rtl8723au/include/usb_hal.h
deleted file mode 100644
index 4edec3b539b7..000000000000
--- a/drivers/staging/rtl8723au/include/usb_hal.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/******************************************************************************
- *
- * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- ******************************************************************************/
-#ifndef __USB_HAL_H__
-#define __USB_HAL_H__
-
-int rtl8723au_set_hal_ops(struct rtw_adapter *padapter);
-
-#endif /* __USB_HAL_H__ */
diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c b/drivers/staging/rtl8723au/os_dep/usb_intf.c
index a3379b7fa178..1e87c681c7bd 100644
--- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
@@ -24,7 +24,6 @@
#include <usb_vendor_req.h>
#include <usb_ops.h>
#include <usb_osintf.h>
-#include <usb_hal.h>
#include <rtl8723a_hal.h>
static int rtw_suspend(struct usb_interface *intf, pm_message_t message);
@@ -616,9 +615,10 @@ static struct rtw_adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
if (rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)))
goto handle_dualmac;
- /* step 2. hook HalFunc, allocate HalData */
- if (rtl8723au_set_hal_ops(padapter))
- return NULL;
+ /* step 2. allocate HalData */
+ padapter->HalData = kzalloc(sizeof(struct hal_data_8723a), GFP_KERNEL);
+ if (!padapter->HalData)
+ goto free_wdev;
padapter->intf_start = &usb_intf_start;
padapter->intf_stop = &usb_intf_stop;
@@ -674,6 +674,7 @@ static struct rtw_adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
free_hal_data:
if (status != _SUCCESS)
kfree(padapter->HalData);
+free_wdev:
if (status != _SUCCESS) {
rtw_wdev_unregister(padapter->rtw_wdev);
rtw_wdev_free(padapter->rtw_wdev);