staging: rtl8712: usb_intf: Remove flush_scheduled_work()
PATCH v2 1/1 staging: rtl8712: usb_intf: Remove flush_scheduled_work()
flush_scheduled_work() flushes out all work items in system_wq. Since one doesn't know what could be running there, flushing work items individually is preferred.
Since there are finite number of work items to be flushed,(viz pwrpriv->SetPSModeWorkItem,pwrpriv->SetPSModeWorkItem,pLed->BlinkWorkItem) instead of flushing system_wq, each work item is separately flushed.
---
Changes in v2:
-Fixed typo in commit message.
drivers/staging/rtl8712/usb_intf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8712/usb_intf.c +3 -1
@@ -627,7 +627,9 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)if (drvpriv.drv_registered) padapter->bSurpriseRemoved = true;unregister_netdev (pnetdev);/* will call netdev_close() */ -flush_scheduled_work (); +cancel_delayed_work (&pwrpriv->SetPSModeWorkItem); +cancel_delayed_work (&pwrpriv->rpwm_workitem); +cancel_delayed_work (&pLed->BlinkWorkItem);udelay (1 );/* Stop driver mlme relation timer */ r8712_stop_drv_timers (padapter);
--
2.1.4
Greg KH
maintainerQuoted 33 lines · Bhaktipriya Shridhar
flush_scheduled_work()flushes out all work items insystem_wq. Since one doesn't know what could be running there, flushing work items individually is preferred.Since there are finite number of work items to be flushed,(viz pwrpriv->SetPSModeWorkItem,pwrpriv->SetPSModeWorkItem,pLed->BlinkWorkItem) instead of flushing
system_wq, each work item is separately flushed.Signed-off-by Bhaktipriya Shridhar <[email protected]>Acked-by Tejun Heo <[email protected]>---
Changes in v2:
-Fixed typo in commit message.drivers/staging/rtl8712/usb_intf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/staging/rtl8712/usb_intf.c +3
-2@@ -627,7 +627,9 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)if (drvpriv.drv_registered) padapter->bSurpriseRemoved = true;unregister_netdev (pnetdev);/* will call netdev_close() */ -flush_scheduled_work (); +cancel_delayed_work (&pwrpriv->SetPSModeWorkItem); +cancel_delayed_work (&pwrpriv->rpwm_workitem); +cancel_delayed_work (&pLed->BlinkWorkItem);udelay (1 );/* Stop driver mlme relation timer */ r8712_stop_drv_timers (padapter); --
Quoted 1 line
2.1.4
This patch does not even build!
Please always test build your patches, to not do so makes maintainers very grumpy...