diff options
author | Abdelrahman Morsy <abdelrahmanhesham94@gmail.com> | 2024-04-02 14:14:06 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-12 11:11:22 +0200 |
commit | ca2da54610f07bbeb298c7dcc260977792fceeee (patch) | |
tree | 5287df714de82ede6fd918a244db72df3d6cf185 /drivers/hid | |
parent | e26d4063d223488ec8239a65a48416334783f92c (diff) | |
download | linux-rpi-ca2da54610f07bbeb298c7dcc260977792fceeee.tar.gz linux-rpi-ca2da54610f07bbeb298c7dcc260977792fceeee.tar.bz2 linux-rpi-ca2da54610f07bbeb298c7dcc260977792fceeee.zip |
HID: mcp-2221: cancel delayed_work only when CONFIG_IIO is enabled
[ Upstream commit 3cba9cfcc1520a2307a29f6fab887bcfc121c417 ]
If the device is unplugged and CONFIG_IIO is not supported, this will
result in a warning message at kernel/workqueue.
Only cancel delayed work in mcp2221_remove(), when CONFIG_IIO is enabled.
Signed-off-by: Abdelrahman Morsy <abdelrahmanhesham94@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-mcp2221.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c index aef0785c91cc..c5bfca8ac5e6 100644 --- a/drivers/hid/hid-mcp2221.c +++ b/drivers/hid/hid-mcp2221.c @@ -922,9 +922,11 @@ static void mcp2221_hid_unregister(void *ptr) /* This is needed to be sure hid_hw_stop() isn't called twice by the subsystem */ static void mcp2221_remove(struct hid_device *hdev) { +#if IS_REACHABLE(CONFIG_IIO) struct mcp2221 *mcp = hid_get_drvdata(hdev); cancel_delayed_work_sync(&mcp->init_work); +#endif } #if IS_REACHABLE(CONFIG_IIO) |