Skip to content

Commit 3cba9cf

Browse files
AbdelrahmanMorsyJiri Kosina
authored andcommitted
HID: mcp-2221: cancel delayed_work only when CONFIG_IIO is enabled
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 21f28a7 commit 3cba9cf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/hid/hid-mcp2221.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,9 +944,11 @@ static void mcp2221_hid_unregister(void *ptr)
944944
/* This is needed to be sure hid_hw_stop() isn't called twice by the subsystem */
945945
static void mcp2221_remove(struct hid_device *hdev)
946946
{
947+
#if IS_REACHABLE(CONFIG_IIO)
947948
struct mcp2221 *mcp = hid_get_drvdata(hdev);
948949

949950
cancel_delayed_work_sync(&mcp->init_work);
951+
#endif
950952
}
951953

952954
#if IS_REACHABLE(CONFIG_IIO)

0 commit comments

Comments
 (0)