LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/4] staging: r8188eu: more power management cleanup
@ 2021-09-11 16:10 Martin Kaiser
  2021-09-11 16:10 ` [PATCH 1/4] staging: r8188eu: bHWPwrPindetect is always false Martin Kaiser
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Martin Kaiser @ 2021-09-11 16:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

bHWPwrPindetect is always 0 for the r8188eu driver. This makes a lot of
code unreachable.

Tested with Edimax EW-7811Un V2 on an ARM32 embedded system.

Martin Kaiser (4):
  staging: r8188eu: bHWPwrPindetect is always false
  staging: r8188eu: brfoffbyhw is always false
  staging: r8188eu: remove rtw_hw_suspend
  staging: r8188eu: remove rtw_hw_resume

 drivers/staging/r8188eu/core/rtw_cmd.c        | 10 --
 drivers/staging/r8188eu/core/rtw_pwrctrl.c    | 20 ----
 .../staging/r8188eu/hal/rtl8188e_hal_init.c   |  4 +-
 drivers/staging/r8188eu/hal/usb_halinit.c     | 14 ---
 drivers/staging/r8188eu/include/osdep_intf.h  |  2 -
 drivers/staging/r8188eu/include/rtw_pwrctrl.h |  2 -
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  7 --
 drivers/staging/r8188eu/os_dep/usb_intf.c     | 99 -------------------
 8 files changed, 2 insertions(+), 156 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/4] staging: r8188eu: bHWPwrPindetect is always false
  2021-09-11 16:10 [PATCH 0/4] staging: r8188eu: more power management cleanup Martin Kaiser
@ 2021-09-11 16:10 ` Martin Kaiser
  2021-09-11 16:10 ` [PATCH 2/4] staging: r8188eu: brfoffbyhw " Martin Kaiser
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Martin Kaiser @ 2021-09-11 16:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The bHWPwrPindetect component of struct pwrctrl_priv is never initialised
explicitly, it remains at its default value 0.

Remove bHWPwrPindetect itself and code that depends on
bHWPwrPindetect != 0.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/core/rtw_cmd.c        | 10 ----------
 drivers/staging/r8188eu/core/rtw_pwrctrl.c    | 20 -------------------
 .../staging/r8188eu/hal/rtl8188e_hal_init.c   |  4 ++--
 drivers/staging/r8188eu/hal/usb_halinit.c     | 14 -------------
 drivers/staging/r8188eu/include/rtw_pwrctrl.h |  1 -
 5 files changed, 2 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index b3695f1282de..c6c539bd7817 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -169,16 +169,6 @@ static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 {
 	u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
 
-	/* To decide allow or not */
-	if ((pcmdpriv->padapter->pwrctrlpriv.bHWPwrPindetect) &&
-	    (!pcmdpriv->padapter->registrypriv.usbss_enable)) {
-		if (cmd_obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra)) {
-			struct drvextra_cmd_parm	*pdrvextra_cmd_parm = (struct drvextra_cmd_parm	*)cmd_obj->parmbuf;
-			if (pdrvextra_cmd_parm->ec_id == POWER_SAVING_CTRL_WK_CID)
-				bAllow = true;
-		}
-	}
-
 	if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
 		bAllow = true;
 
diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
index cf3673be5ac6..d901ac7aea4d 100644
--- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
@@ -135,32 +135,12 @@ void rtw_ps_processor(struct adapter *padapter)
 {
 	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	enum rt_rf_power_state rfpwrstate;
 
 	pwrpriv->ps_processing = true;
 
 	if (pwrpriv->bips_processing)
 		goto exit;
 
-	if (padapter->pwrctrlpriv.bHWPwrPindetect) {
-		rfpwrstate = RfOnOffDetect(padapter);
-		DBG_88E("@@@@- #2  %s==> rfstate:%s\n", __func__, (rfpwrstate == rf_on) ? "rf_on" : "rf_off");
-
-		if (rfpwrstate != pwrpriv->rf_pwrstate) {
-			if (rfpwrstate == rf_off) {
-				pwrpriv->change_rfpwrstate = rf_off;
-				pwrpriv->brfoffbyhw = true;
-				padapter->bCardDisableWOHSM = true;
-				rtw_hw_suspend(padapter);
-			} else {
-				pwrpriv->change_rfpwrstate = rf_on;
-				rtw_hw_resume(padapter);
-			}
-			DBG_88E("current rf_pwrstate(%s)\n", (pwrpriv->rf_pwrstate == rf_off) ? "rf_off" : "rf_on");
-		}
-		pwrpriv->pwr_state_check_cnts++;
-	}
-
 	if (pwrpriv->ips_mode_req == IPS_NONE)
 		goto exit;
 
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 5ea96a5ac630..bb0d7e071f57 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -2008,8 +2008,8 @@ void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoL
 		/*  if hw supported, 8051 (SIE) will generate WeakUP signal(D+/D- toggle) when autoresume */
 		padapter->pwrctrlpriv.bSupportRemoteWakeup = (hwinfo[EEPROM_USB_OPTIONAL_FUNCTION0] & BIT(1)) ? true : false;
 
-		DBG_88E("%s...bHWPwrPindetect(%x)-bHWPowerdown(%x) , bSupportRemoteWakeup(%x)\n", __func__,
-		padapter->pwrctrlpriv.bHWPwrPindetect, padapter->pwrctrlpriv.bHWPowerdown, padapter->pwrctrlpriv.bSupportRemoteWakeup);
+		DBG_88E("%s...bHWPowerdown(%x) , bSupportRemoteWakeup(%x)\n", __func__,
+			padapter->pwrctrlpriv.bHWPowerdown, padapter->pwrctrlpriv.bSupportRemoteWakeup);
 
 		DBG_88E("### PS params =>  power_mgnt(%x), usbss_enable(%x) ###\n", padapter->registrypriv.power_mgnt, padapter->registrypriv.usbss_enable);
 	}
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 62d9e656e1db..63b992610337 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1008,15 +1008,6 @@ static void CardDisableRTL8188EU(struct adapter *Adapter)
 	haldata->bMacPwrCtrlOn = false;
 	Adapter->bFWReady = false;
 }
-static void rtl8192cu_hw_power_down(struct adapter *adapt)
-{
-	/*  2010/-8/09 MH For power down module, we need to enable register block contrl reg at 0x1c. */
-	/*  Then enable power down control bit of register 0x04 BIT(4) and BIT(15) as 1. */
-
-	/*  Enable register area 0x0-0xc. */
-	rtw_write8(adapt, REG_RSV_CTRL, 0x0);
-	rtw_write16(adapt, REG_APS_FSMCO, 0x8812);
-}
 
 static u32 rtl8188eu_hal_deinit(struct adapter *Adapter)
 {
@@ -1029,14 +1020,9 @@ static u32 rtl8188eu_hal_deinit(struct adapter *Adapter)
 	DBG_88E("bkeepfwalive(%x)\n", Adapter->pwrctrlpriv.bkeepfwalive);
 	if (Adapter->pwrctrlpriv.bkeepfwalive) {
 		_ps_close_RF(Adapter);
-		if ((Adapter->pwrctrlpriv.bHWPwrPindetect) && (Adapter->pwrctrlpriv.bHWPowerdown))
-			rtl8192cu_hw_power_down(Adapter);
 	} else {
 		if (Adapter->hw_init_completed) {
 			CardDisableRTL8188EU(Adapter);
-
-			if ((Adapter->pwrctrlpriv.bHWPwrPindetect) && (Adapter->pwrctrlpriv.bHWPowerdown))
-				rtl8192cu_hw_power_down(Adapter);
 		}
 	}
 	return _SUCCESS;
diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
index 69ea7925feef..28e4041acb98 100644
--- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
@@ -113,7 +113,6 @@ struct pwrctrl_priv {
 
 	u8		wepkeymask;
 	u8		bHWPowerdown;/* if support hw power down */
-	u8		bHWPwrPindetect;
 	u8		bkeepfwalive;
 	u8		brfoffbyhw;
 };
-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 2/4] staging: r8188eu: brfoffbyhw is always false
  2021-09-11 16:10 [PATCH 0/4] staging: r8188eu: more power management cleanup Martin Kaiser
  2021-09-11 16:10 ` [PATCH 1/4] staging: r8188eu: bHWPwrPindetect is always false Martin Kaiser
@ 2021-09-11 16:10 ` Martin Kaiser
  2021-09-11 16:10 ` [PATCH 3/4] staging: r8188eu: remove rtw_hw_suspend Martin Kaiser
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Martin Kaiser @ 2021-09-11 16:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

As a consequence of the bHWPwrPindetect removal, brfoffbyhw is never set
to true any more. Remove the variable and code that depends on
brfoffbyhw == true.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_pwrctrl.h | 1 -
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  | 7 -------
 drivers/staging/r8188eu/os_dep/usb_intf.c     | 1 -
 3 files changed, 9 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
index 28e4041acb98..a77fb76a0b09 100644
--- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
@@ -114,7 +114,6 @@ struct pwrctrl_priv {
 	u8		wepkeymask;
 	u8		bHWPowerdown;/* if support hw power down */
 	u8		bkeepfwalive;
-	u8		brfoffbyhw;
 };
 
 #define rtw_get_ips_mode_req(pwrctrlpriv) \
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index 911bcb69d008..b6f2fa3abb6e 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -1289,11 +1289,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
 	int wait_status;
 	struct	wifidirect_info *pwdinfo = &padapter->wdinfo;
 
-	if (padapter->pwrctrlpriv.brfoffbyhw && padapter->bDriverStopped) {
-		ret = -EINVAL;
-		goto exit;
-	}
-
 	if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
 		/*	P2P is enabled */
 		wait_for_surveydone = 200;
@@ -1336,8 +1331,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
 	wrqu->data.length = ev - extra;
 	wrqu->data.flags = 0;
 
-exit:
-
 	return ret;
 }
 
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index b174cc69ded7..fc5ed770cb71 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -364,7 +364,6 @@ int rtw_hw_resume(struct adapter *padapter)
 		netif_wake_queue(pnetdev);
 
 	pwrpriv->bkeepfwalive = false;
-	pwrpriv->brfoffbyhw = false;
 
 	pwrpriv->rf_pwrstate = rf_on;
 	pwrpriv->bips_processing = false;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 3/4] staging: r8188eu: remove rtw_hw_suspend
  2021-09-11 16:10 [PATCH 0/4] staging: r8188eu: more power management cleanup Martin Kaiser
  2021-09-11 16:10 ` [PATCH 1/4] staging: r8188eu: bHWPwrPindetect is always false Martin Kaiser
  2021-09-11 16:10 ` [PATCH 2/4] staging: r8188eu: brfoffbyhw " Martin Kaiser
@ 2021-09-11 16:10 ` Martin Kaiser
  2021-09-11 16:10 ` [PATCH 4/4] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Martin Kaiser @ 2021-09-11 16:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The bHWPwrPindetect cleanup removed the only call to rtw_hw_suspend.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/osdep_intf.h |  1 -
 drivers/staging/r8188eu/os_dep/usb_intf.c    | 59 --------------------
 2 files changed, 60 deletions(-)

diff --git a/drivers/staging/r8188eu/include/osdep_intf.h b/drivers/staging/r8188eu/include/osdep_intf.h
index 3ea60feee2db..5a2c7a98f023 100644
--- a/drivers/staging/r8188eu/include/osdep_intf.h
+++ b/drivers/staging/r8188eu/include/osdep_intf.h
@@ -58,7 +58,6 @@ void rtw_ips_dev_unload(struct adapter *padapter);
 
 int rtw_ips_pwr_up(struct adapter *padapter);
 void rtw_ips_pwr_down(struct adapter *padapter);
-int rtw_hw_suspend(struct adapter *padapter);
 int rtw_hw_resume(struct adapter *padapter);
 
 #endif	/* _OSDEP_INTF_H_ */
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index fc5ed770cb71..f532dab0254c 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -278,65 +278,6 @@ static void process_spec_devid(const struct usb_device_id *pdid)
 	}
 }
 
-int rtw_hw_suspend(struct adapter *padapter)
-{
-	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
-	struct net_device *pnetdev = padapter->pnetdev;
-
-	if ((!padapter->bup) || (padapter->bDriverStopped) ||
-	    (padapter->bSurpriseRemoved)) {
-		DBG_88E("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
-			padapter->bup, padapter->bDriverStopped,
-			padapter->bSurpriseRemoved);
-		goto error_exit;
-	}
-
-	LeaveAllPowerSaveMode(padapter);
-
-	DBG_88E("==> rtw_hw_suspend\n");
-	_enter_pwrlock(&pwrpriv->lock);
-	pwrpriv->bips_processing = true;
-	/* s1. */
-	if (pnetdev) {
-		netif_carrier_off(pnetdev);
-		rtw_netif_stop_queue(pnetdev);
-	}
-
-	/* s2. */
-	rtw_disassoc_cmd(padapter, 500, false);
-
-	/* s2-2.  indicate disconnect to os */
-	{
-		struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
-
-		if (check_fwstate(pmlmepriv, _FW_LINKED)) {
-			_clr_fwstate_(pmlmepriv, _FW_LINKED);
-
-			rtw_led_control(padapter, LED_CTL_NO_LINK);
-
-			rtw_os_indicate_disconnect(padapter);
-
-			/* donnot enqueue cmd */
-			rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0);
-		}
-	}
-	/* s2-3. */
-	rtw_free_assoc_resources(padapter, 1);
-
-	/* s2-4. */
-	rtw_free_network_queue(padapter, true);
-	rtw_ips_dev_unload(padapter);
-	pwrpriv->rf_pwrstate = rf_off;
-	pwrpriv->bips_processing = false;
-
-	_exit_pwrlock(&pwrpriv->lock);
-	return 0;
-
-error_exit:
-	DBG_88E("%s, failed\n", __func__);
-	return -1;
-}
-
 int rtw_hw_resume(struct adapter *padapter)
 {
 	struct pwrctrl_priv *pwrpriv;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 4/4] staging: r8188eu: remove rtw_hw_resume
  2021-09-11 16:10 [PATCH 0/4] staging: r8188eu: more power management cleanup Martin Kaiser
                   ` (2 preceding siblings ...)
  2021-09-11 16:10 ` [PATCH 3/4] staging: r8188eu: remove rtw_hw_suspend Martin Kaiser
@ 2021-09-11 16:10 ` Martin Kaiser
  2021-09-13 16:22 ` [PATCH 0/4] staging: r8188eu: more power management cleanup Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Martin Kaiser @ 2021-09-11 16:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The bHWPwrPindetect cleanup removed the only call to rtw_hw_resume.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/osdep_intf.h |  1 -
 drivers/staging/r8188eu/os_dep/usb_intf.c    | 39 --------------------
 2 files changed, 40 deletions(-)

diff --git a/drivers/staging/r8188eu/include/osdep_intf.h b/drivers/staging/r8188eu/include/osdep_intf.h
index 5a2c7a98f023..da36770852f8 100644
--- a/drivers/staging/r8188eu/include/osdep_intf.h
+++ b/drivers/staging/r8188eu/include/osdep_intf.h
@@ -58,6 +58,5 @@ void rtw_ips_dev_unload(struct adapter *padapter);
 
 int rtw_ips_pwr_up(struct adapter *padapter);
 void rtw_ips_pwr_down(struct adapter *padapter);
-int rtw_hw_resume(struct adapter *padapter);
 
 #endif	/* _OSDEP_INTF_H_ */
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index f532dab0254c..da381f42f3f6 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -278,45 +278,6 @@ static void process_spec_devid(const struct usb_device_id *pdid)
 	}
 }
 
-int rtw_hw_resume(struct adapter *padapter)
-{
-	struct pwrctrl_priv *pwrpriv;
-	struct net_device *pnetdev = padapter->pnetdev;
-
-	if (!padapter)
-		goto error_exit;
-	pwrpriv = &padapter->pwrctrlpriv;
-	DBG_88E("==> rtw_hw_resume\n");
-	_enter_pwrlock(&pwrpriv->lock);
-	pwrpriv->bips_processing = true;
-	rtw_reset_drv_sw(padapter);
-
-	if (pm_netdev_open(pnetdev, false) != 0) {
-		_exit_pwrlock(&pwrpriv->lock);
-		goto error_exit;
-	}
-
-	netif_device_attach(pnetdev);
-	netif_carrier_on(pnetdev);
-
-	if (!netif_queue_stopped(pnetdev))
-		netif_start_queue(pnetdev);
-	else
-		netif_wake_queue(pnetdev);
-
-	pwrpriv->bkeepfwalive = false;
-
-	pwrpriv->rf_pwrstate = rf_on;
-	pwrpriv->bips_processing = false;
-
-	_exit_pwrlock(&pwrpriv->lock);
-
-	return 0;
-error_exit:
-	DBG_88E("%s, Open net dev failed\n", __func__);
-	return -1;
-}
-
 static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
 {
 	struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/4] staging: r8188eu: more power management cleanup
  2021-09-11 16:10 [PATCH 0/4] staging: r8188eu: more power management cleanup Martin Kaiser
                   ` (3 preceding siblings ...)
  2021-09-11 16:10 ` [PATCH 4/4] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
@ 2021-09-13 16:22 ` Greg Kroah-Hartman
  2021-09-13 18:59 ` [PATCH v2 0/2] " Martin Kaiser
  2021-09-18 13:57 ` [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false Martin Kaiser
  6 siblings, 0 replies; 14+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-13 16:22 UTC (permalink / raw)
  To: Martin Kaiser
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel

On Sat, Sep 11, 2021 at 06:10:15PM +0200, Martin Kaiser wrote:
> bHWPwrPindetect is always 0 for the r8188eu driver. This makes a lot of
> code unreachable.
> 
> Tested with Edimax EW-7811Un V2 on an ARM32 embedded system.
> 
> Martin Kaiser (4):
>   staging: r8188eu: bHWPwrPindetect is always false
>   staging: r8188eu: brfoffbyhw is always false
>   staging: r8188eu: remove rtw_hw_suspend
>   staging: r8188eu: remove rtw_hw_resume
> 
>  drivers/staging/r8188eu/core/rtw_cmd.c        | 10 --
>  drivers/staging/r8188eu/core/rtw_pwrctrl.c    | 20 ----
>  .../staging/r8188eu/hal/rtl8188e_hal_init.c   |  4 +-
>  drivers/staging/r8188eu/hal/usb_halinit.c     | 14 ---
>  drivers/staging/r8188eu/include/osdep_intf.h  |  2 -
>  drivers/staging/r8188eu/include/rtw_pwrctrl.h |  2 -
>  drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  7 --
>  drivers/staging/r8188eu/os_dep/usb_intf.c     | 99 -------------------
>  8 files changed, 2 insertions(+), 156 deletions(-)
> 
> -- 
> 2.20.1
> 
> 

I have applied 2 of these, please rebase and resend the rest.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 0/2] staging: r8188eu: more power management cleanup
  2021-09-11 16:10 [PATCH 0/4] staging: r8188eu: more power management cleanup Martin Kaiser
                   ` (4 preceding siblings ...)
  2021-09-13 16:22 ` [PATCH 0/4] staging: r8188eu: more power management cleanup Greg Kroah-Hartman
@ 2021-09-13 18:59 ` Martin Kaiser
  2021-09-13 18:59   ` [PATCH v2 1/2] staging: r8188eu: brfoffbyhw is always false Martin Kaiser
                     ` (2 more replies)
  2021-09-18 13:57 ` [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false Martin Kaiser
  6 siblings, 3 replies; 14+ messages in thread
From: Martin Kaiser @ 2021-09-13 18:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

bHWPwrPindetect is always 0 for the r8188eu driver. This makes a lot of
code unreachable.

Tested with Edimax EW-7811Un V2 on an ARM32 embedded system.

v2:
- rebased against today's staging-testing branch

Martin Kaiser (2):
  staging: r8188eu: brfoffbyhw is always false
  staging: r8188eu: remove rtw_hw_resume

 drivers/staging/r8188eu/include/osdep_intf.h  |  1 -
 drivers/staging/r8188eu/include/rtw_pwrctrl.h |  1 -
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  7 ----
 drivers/staging/r8188eu/os_dep/usb_intf.c     | 40 -------------------
 4 files changed, 49 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 1/2] staging: r8188eu: brfoffbyhw is always false
  2021-09-13 18:59 ` [PATCH v2 0/2] " Martin Kaiser
@ 2021-09-13 18:59   ` Martin Kaiser
  2021-09-13 18:59   ` [PATCH v2 2/2] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
  2021-09-14  7:14   ` [PATCH v2 0/2] staging: r8188eu: more power management cleanup Greg Kroah-Hartman
  2 siblings, 0 replies; 14+ messages in thread
From: Martin Kaiser @ 2021-09-13 18:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

As a consequence of the bHWPwrPindetect removal, brfoffbyhw is never set
to true any more. Remove the variable and code that depends on
brfoffbyhw == true.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
v2:
- rebased against today's staging-testing branch

 drivers/staging/r8188eu/include/rtw_pwrctrl.h | 1 -
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  | 7 -------
 drivers/staging/r8188eu/os_dep/usb_intf.c     | 1 -
 3 files changed, 9 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
index 28e4041acb98..a77fb76a0b09 100644
--- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
@@ -114,7 +114,6 @@ struct pwrctrl_priv {
 	u8		wepkeymask;
 	u8		bHWPowerdown;/* if support hw power down */
 	u8		bkeepfwalive;
-	u8		brfoffbyhw;
 };
 
 #define rtw_get_ips_mode_req(pwrctrlpriv) \
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index ac218da94ce5..a76cb7bd6390 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -1289,11 +1289,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
 	int wait_status;
 	struct	wifidirect_info *pwdinfo = &padapter->wdinfo;
 
-	if (padapter->pwrctrlpriv.brfoffbyhw && padapter->bDriverStopped) {
-		ret = -EINVAL;
-		goto exit;
-	}
-
 	if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
 		/*	P2P is enabled */
 		wait_for_surveydone = 200;
@@ -1336,8 +1331,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
 	wrqu->data.length = ev - extra;
 	wrqu->data.flags = 0;
 
-exit:
-
 	return ret;
 }
 
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index d04d2f658ce0..a23b0becb668 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -305,7 +305,6 @@ int rtw_hw_resume(struct adapter *padapter)
 		netif_wake_queue(pnetdev);
 
 	pwrpriv->bkeepfwalive = false;
-	pwrpriv->brfoffbyhw = false;
 
 	pwrpriv->rf_pwrstate = rf_on;
 	pwrpriv->bips_processing = false;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 2/2] staging: r8188eu: remove rtw_hw_resume
  2021-09-13 18:59 ` [PATCH v2 0/2] " Martin Kaiser
  2021-09-13 18:59   ` [PATCH v2 1/2] staging: r8188eu: brfoffbyhw is always false Martin Kaiser
@ 2021-09-13 18:59   ` Martin Kaiser
  2021-09-14  7:14   ` [PATCH v2 0/2] staging: r8188eu: more power management cleanup Greg Kroah-Hartman
  2 siblings, 0 replies; 14+ messages in thread
From: Martin Kaiser @ 2021-09-13 18:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The bHWPwrPindetect cleanup removed the only call to rtw_hw_resume.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
v2:
- rebased against today's staging-testing branch

 drivers/staging/r8188eu/include/osdep_intf.h |  1 -
 drivers/staging/r8188eu/os_dep/usb_intf.c    | 39 --------------------
 2 files changed, 40 deletions(-)

diff --git a/drivers/staging/r8188eu/include/osdep_intf.h b/drivers/staging/r8188eu/include/osdep_intf.h
index 5a2c7a98f023..da36770852f8 100644
--- a/drivers/staging/r8188eu/include/osdep_intf.h
+++ b/drivers/staging/r8188eu/include/osdep_intf.h
@@ -58,6 +58,5 @@ void rtw_ips_dev_unload(struct adapter *padapter);
 
 int rtw_ips_pwr_up(struct adapter *padapter);
 void rtw_ips_pwr_down(struct adapter *padapter);
-int rtw_hw_resume(struct adapter *padapter);
 
 #endif	/* _OSDEP_INTF_H_ */
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index a23b0becb668..c40246bbb4f4 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -278,45 +278,6 @@ static void process_spec_devid(const struct usb_device_id *pdid)
 	}
 }
 
-int rtw_hw_resume(struct adapter *padapter)
-{
-	struct pwrctrl_priv *pwrpriv;
-	struct net_device *pnetdev = padapter->pnetdev;
-
-	if (!padapter)
-		goto error_exit;
-	pwrpriv = &padapter->pwrctrlpriv;
-	DBG_88E("==> rtw_hw_resume\n");
-	_enter_pwrlock(&pwrpriv->lock);
-	pwrpriv->bips_processing = true;
-	rtw_reset_drv_sw(padapter);
-
-	if (pm_netdev_open(pnetdev, false) != 0) {
-		_exit_pwrlock(&pwrpriv->lock);
-		goto error_exit;
-	}
-
-	netif_device_attach(pnetdev);
-	netif_carrier_on(pnetdev);
-
-	if (!netif_queue_stopped(pnetdev))
-		netif_start_queue(pnetdev);
-	else
-		netif_wake_queue(pnetdev);
-
-	pwrpriv->bkeepfwalive = false;
-
-	pwrpriv->rf_pwrstate = rf_on;
-	pwrpriv->bips_processing = false;
-
-	_exit_pwrlock(&pwrpriv->lock);
-
-	return 0;
-error_exit:
-	DBG_88E("%s, Open net dev failed\n", __func__);
-	return -1;
-}
-
 static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
 {
 	struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 0/2] staging: r8188eu: more power management cleanup
  2021-09-13 18:59 ` [PATCH v2 0/2] " Martin Kaiser
  2021-09-13 18:59   ` [PATCH v2 1/2] staging: r8188eu: brfoffbyhw is always false Martin Kaiser
  2021-09-13 18:59   ` [PATCH v2 2/2] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
@ 2021-09-14  7:14   ` Greg Kroah-Hartman
  2 siblings, 0 replies; 14+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-14  7:14 UTC (permalink / raw)
  To: Martin Kaiser
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel

On Mon, Sep 13, 2021 at 08:59:55PM +0200, Martin Kaiser wrote:
> bHWPwrPindetect is always 0 for the r8188eu driver. This makes a lot of
> code unreachable.
> 
> Tested with Edimax EW-7811Un V2 on an ARM32 embedded system.
> 
> v2:
> - rebased against today's staging-testing branch
> 
> Martin Kaiser (2):
>   staging: r8188eu: brfoffbyhw is always false
>   staging: r8188eu: remove rtw_hw_resume
> 
>  drivers/staging/r8188eu/include/osdep_intf.h  |  1 -
>  drivers/staging/r8188eu/include/rtw_pwrctrl.h |  1 -
>  drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  7 ----
>  drivers/staging/r8188eu/os_dep/usb_intf.c     | 40 -------------------
>  4 files changed, 49 deletions(-)
> 
> -- 
> 2.20.1
> 
> 

Series does not apply to my tree :(

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false
  2021-09-11 16:10 [PATCH 0/4] staging: r8188eu: more power management cleanup Martin Kaiser
                   ` (5 preceding siblings ...)
  2021-09-13 18:59 ` [PATCH v2 0/2] " Martin Kaiser
@ 2021-09-18 13:57 ` Martin Kaiser
  2021-09-18 13:57   ` [PATCH v3 2/2] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
  2021-09-18 14:59   ` [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false Michael Straube
  6 siblings, 2 replies; 14+ messages in thread
From: Martin Kaiser @ 2021-09-18 13:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

As a consequence of the bHWPwrPindetect removal, brfoffbyhw is never set
to true any more. Remove the variable and code that depends on
brfoffbyhw == true.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
v3:
- another rebase against today's staging-testing branch

v2:
- rebased against today's staging-testing branch

 drivers/staging/r8188eu/include/rtw_pwrctrl.h | 1 -
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  | 7 -------
 drivers/staging/r8188eu/os_dep/usb_intf.c     | 1 -
 3 files changed, 9 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
index 28e4041acb98..a77fb76a0b09 100644
--- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
@@ -114,7 +114,6 @@ struct pwrctrl_priv {
 	u8		wepkeymask;
 	u8		bHWPowerdown;/* if support hw power down */
 	u8		bkeepfwalive;
-	u8		brfoffbyhw;
 };
 
 #define rtw_get_ips_mode_req(pwrctrlpriv) \
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index ac218da94ce5..a76cb7bd6390 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -1289,11 +1289,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
 	int wait_status;
 	struct	wifidirect_info *pwdinfo = &padapter->wdinfo;
 
-	if (padapter->pwrctrlpriv.brfoffbyhw && padapter->bDriverStopped) {
-		ret = -EINVAL;
-		goto exit;
-	}
-
 	if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
 		/*	P2P is enabled */
 		wait_for_surveydone = 200;
@@ -1336,8 +1331,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
 	wrqu->data.length = ev - extra;
 	wrqu->data.flags = 0;
 
-exit:
-
 	return ret;
 }
 
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 306325818a9a..25dc90847380 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -305,7 +305,6 @@ int rtw_hw_resume(struct adapter *padapter)
 		netif_wake_queue(pnetdev);
 
 	pwrpriv->bkeepfwalive = false;
-	pwrpriv->brfoffbyhw = false;
 
 	pwrpriv->rf_pwrstate = rf_on;
 	pwrpriv->bips_processing = false;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3 2/2] staging: r8188eu: remove rtw_hw_resume
  2021-09-18 13:57 ` [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false Martin Kaiser
@ 2021-09-18 13:57   ` Martin Kaiser
  2021-09-18 15:16     ` Michael Straube
  2021-09-18 14:59   ` [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false Michael Straube
  1 sibling, 1 reply; 14+ messages in thread
From: Martin Kaiser @ 2021-09-18 13:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Commit c0a099b7341c ("staging: r8188eu: bHWPwrPindetect is always false")
removed the only call to rtw_hw_resume.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
v3:
- another rebase against today's staging-testing branch

v2:
- rebased against today's staging-testing branch

 drivers/staging/r8188eu/include/osdep_intf.h |  1 -
 drivers/staging/r8188eu/os_dep/usb_intf.c    | 39 --------------------
 2 files changed, 40 deletions(-)

diff --git a/drivers/staging/r8188eu/include/osdep_intf.h b/drivers/staging/r8188eu/include/osdep_intf.h
index 5a2c7a98f023..da36770852f8 100644
--- a/drivers/staging/r8188eu/include/osdep_intf.h
+++ b/drivers/staging/r8188eu/include/osdep_intf.h
@@ -58,6 +58,5 @@ void rtw_ips_dev_unload(struct adapter *padapter);
 
 int rtw_ips_pwr_up(struct adapter *padapter);
 void rtw_ips_pwr_down(struct adapter *padapter);
-int rtw_hw_resume(struct adapter *padapter);
 
 #endif	/* _OSDEP_INTF_H_ */
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 25dc90847380..11a584cbe9d8 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -278,45 +278,6 @@ static void process_spec_devid(const struct usb_device_id *pdid)
 	}
 }
 
-int rtw_hw_resume(struct adapter *padapter)
-{
-	struct pwrctrl_priv *pwrpriv;
-	struct net_device *pnetdev = padapter->pnetdev;
-
-	if (!padapter)
-		goto error_exit;
-	pwrpriv = &padapter->pwrctrlpriv;
-	DBG_88E("==> rtw_hw_resume\n");
-	_enter_pwrlock(&pwrpriv->lock);
-	pwrpriv->bips_processing = true;
-	rtw_reset_drv_sw(padapter);
-
-	if (pm_netdev_open(pnetdev, false) != 0) {
-		_exit_pwrlock(&pwrpriv->lock);
-		goto error_exit;
-	}
-
-	netif_device_attach(pnetdev);
-	netif_carrier_on(pnetdev);
-
-	if (!netif_queue_stopped(pnetdev))
-		netif_start_queue(pnetdev);
-	else
-		netif_wake_queue(pnetdev);
-
-	pwrpriv->bkeepfwalive = false;
-
-	pwrpriv->rf_pwrstate = rf_on;
-	pwrpriv->bips_processing = false;
-
-	_exit_pwrlock(&pwrpriv->lock);
-
-	return 0;
-error_exit:
-	DBG_88E("%s, Open net dev failed\n", __func__);
-	return -1;
-}
-
 static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
 {
 	struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false
  2021-09-18 13:57 ` [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false Martin Kaiser
  2021-09-18 13:57   ` [PATCH v3 2/2] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
@ 2021-09-18 14:59   ` Michael Straube
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Straube @ 2021-09-18 14:59 UTC (permalink / raw)
  To: Martin Kaiser, Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, linux-staging, linux-kernel

On 9/18/21 15:57, Martin Kaiser wrote:
> As a consequence of the bHWPwrPindetect removal, brfoffbyhw is never set
> to true any more. Remove the variable and code that depends on
> brfoffbyhw == true.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> v3:
> - another rebase against today's staging-testing branch
> 
> v2:
> - rebased against today's staging-testing branch
> 
>   drivers/staging/r8188eu/include/rtw_pwrctrl.h | 1 -
>   drivers/staging/r8188eu/os_dep/ioctl_linux.c  | 7 -------
>   drivers/staging/r8188eu/os_dep/usb_intf.c     | 1 -
>   3 files changed, 9 deletions(-)
> 

Looks good to me.

Acked-by: Michael Straube <straube.linux@gmail.com>

Thanks,
Michael


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 2/2] staging: r8188eu: remove rtw_hw_resume
  2021-09-18 13:57   ` [PATCH v3 2/2] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
@ 2021-09-18 15:16     ` Michael Straube
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Straube @ 2021-09-18 15:16 UTC (permalink / raw)
  To: Martin Kaiser, Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, linux-staging, linux-kernel

On 9/18/21 15:57, Martin Kaiser wrote:
> Commit c0a099b7341c ("staging: r8188eu: bHWPwrPindetect is always false")
> removed the only call to rtw_hw_resume.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> v3:
> - another rebase against today's staging-testing branch
> 
> v2:
> - rebased against today's staging-testing branch
> 
>   drivers/staging/r8188eu/include/osdep_intf.h |  1 -
>   drivers/staging/r8188eu/os_dep/usb_intf.c    | 39 --------------------
>   2 files changed, 40 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/include/osdep_intf.h b/drivers/staging/r8188eu/include/osdep_intf.h
> index 5a2c7a98f023..da36770852f8 100644
> --- a/drivers/staging/r8188eu/include/osdep_intf.h
> +++ b/drivers/staging/r8188eu/include/osdep_intf.h
> @@ -58,6 +58,5 @@ void rtw_ips_dev_unload(struct adapter *padapter);
>   
>   int rtw_ips_pwr_up(struct adapter *padapter);
>   void rtw_ips_pwr_down(struct adapter *padapter);
> -int rtw_hw_resume(struct adapter *padapter);
>   
>   #endif	/* _OSDEP_INTF_H_ */
> diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
> index 25dc90847380..11a584cbe9d8 100644
> --- a/drivers/staging/r8188eu/os_dep/usb_intf.c
> +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
> @@ -278,45 +278,6 @@ static void process_spec_devid(const struct usb_device_id *pdid)
>   	}
>   }
>   
> -int rtw_hw_resume(struct adapter *padapter)
> -{
> -	struct pwrctrl_priv *pwrpriv;
> -	struct net_device *pnetdev = padapter->pnetdev;
> -
> -	if (!padapter)
> -		goto error_exit;
> -	pwrpriv = &padapter->pwrctrlpriv;
> -	DBG_88E("==> rtw_hw_resume\n");
> -	_enter_pwrlock(&pwrpriv->lock);
> -	pwrpriv->bips_processing = true;
> -	rtw_reset_drv_sw(padapter);
> -
> -	if (pm_netdev_open(pnetdev, false) != 0) {
> -		_exit_pwrlock(&pwrpriv->lock);
> -		goto error_exit;
> -	}
> -
> -	netif_device_attach(pnetdev);
> -	netif_carrier_on(pnetdev);
> -
> -	if (!netif_queue_stopped(pnetdev))
> -		netif_start_queue(pnetdev);
> -	else
> -		netif_wake_queue(pnetdev);
> -
> -	pwrpriv->bkeepfwalive = false;
> -
> -	pwrpriv->rf_pwrstate = rf_on;
> -	pwrpriv->bips_processing = false;
> -
> -	_exit_pwrlock(&pwrpriv->lock);
> -
> -	return 0;
> -error_exit:
> -	DBG_88E("%s, Open net dev failed\n", __func__);
> -	return -1;
> -}
> -
>   static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
>   {
>   	struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
> 

Looks good to me.

Acked-by: Michael Straube <straube.linux@gmail.com>

Thanks,
Michael

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-09-18 15:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-11 16:10 [PATCH 0/4] staging: r8188eu: more power management cleanup Martin Kaiser
2021-09-11 16:10 ` [PATCH 1/4] staging: r8188eu: bHWPwrPindetect is always false Martin Kaiser
2021-09-11 16:10 ` [PATCH 2/4] staging: r8188eu: brfoffbyhw " Martin Kaiser
2021-09-11 16:10 ` [PATCH 3/4] staging: r8188eu: remove rtw_hw_suspend Martin Kaiser
2021-09-11 16:10 ` [PATCH 4/4] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
2021-09-13 16:22 ` [PATCH 0/4] staging: r8188eu: more power management cleanup Greg Kroah-Hartman
2021-09-13 18:59 ` [PATCH v2 0/2] " Martin Kaiser
2021-09-13 18:59   ` [PATCH v2 1/2] staging: r8188eu: brfoffbyhw is always false Martin Kaiser
2021-09-13 18:59   ` [PATCH v2 2/2] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
2021-09-14  7:14   ` [PATCH v2 0/2] staging: r8188eu: more power management cleanup Greg Kroah-Hartman
2021-09-18 13:57 ` [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false Martin Kaiser
2021-09-18 13:57   ` [PATCH v3 2/2] staging: r8188eu: remove rtw_hw_resume Martin Kaiser
2021-09-18 15:16     ` Michael Straube
2021-09-18 14:59   ` [PATCH v3 1/2] staging: r8188eu: brfoffbyhw is always false Michael Straube

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).