Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mwifiex: uninit wakeup info when removing device

We manually init wakeup info, but we don't detach it on device removal.
This means that if we (for example) rmmod + modprobe the driver, the
device framework might return -EEXIST the second time, and we'll
complain in the logs:

[ 839.311881] mwifiex_pcie 0000:01:00.0: fail to init wakeup for mwifiex

AFAICT, there's no other negative effect.

But we can fix this by disabling wakeup on remove, similar to what a few
other drivers do (e.g., the power supply framework).

This code (and bug) has existed on SDIO for a while, but it got moved
around and enabled for PCIe with commit 853402a00823 ("mwifiex: Enable
WoWLAN for both sdio and pcie").

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Brian Norris and committed by
Kalle Valo
36908c4e ba1c7e45

+3
+3
drivers/net/wireless/marvell/mwifiex/main.c
··· 1718 1718 wiphy_unregister(adapter->wiphy); 1719 1719 wiphy_free(adapter->wiphy); 1720 1720 1721 + if (adapter->irq_wakeup >= 0) 1722 + device_init_wakeup(adapter->dev, false); 1723 + 1721 1724 /* Unregister device */ 1722 1725 mwifiex_dbg(adapter, INFO, 1723 1726 "info: unregister device\n");