On 6/10/2022 12:05 PM, Jeff Johnson wrote:
On 6/10/2022 4:12 AM, Tetsuo Handa wrote:
Use local wq in order to avoid flush_scheduled_work() usage.
Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
---
Please see commit c4f135d643823a86 ("workqueue: Wrap flush_workqueue()
using a macro") for background.
This is a blind conversion, and is only compile tested.
drivers/net/wireless/ath/ath6kl/usb.c | 29 +++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/usb.c
b/drivers/net/wireless/ath/ath6kl/usb.c
[snip]
-module_usb_driver(ath6kl_usb_driver);
+static int __init ath6kl_init(void)
+{
+ int ret;
+
+ ath6kl_wq = alloc_workqueue("ath6kl_wq", 0, 0);
+ if (!ath6kl_wq)
+ return -ENOMEM;
this approach means the driver will always allocate a workqueue even if
the associated hardware is never present.
did you consider instead having the allocation take place within the
processing of ath6kl_usb_probe() and the destroy take place within the
processing of ath6kl_usb_pm_remove()?
typo: ath6kl_usb_pm_remove() => ath6kl_usb_remove()