Skip to content

Commit

Permalink
Input: wm97xx-ts - fix exit path
Browse files Browse the repository at this point in the history
Loading then unloading wm97xx-ts.ko when CONFIG_AC97_BUS=m
causes a WARNING: from drivers/base/driver.c:

Unexpected driver unregister!
WARNING: CPU: 0 PID: 1709 at ../drivers/base/driver.c:193 driver_unregister+0x30/0x40

Fix this by only calling driver_unregister() with the same
condition that driver_register() is called.

Fixes: ae9d1b5 ("Input: wm97xx: add new AC97 bus support")

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Randy Dunlap authored and Dmitry Torokhov committed Oct 15, 2018
1 parent d9265e8 commit a3f7c3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/input/touchscreen/wm97xx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,8 @@ static int __init wm97xx_init(void)

static void __exit wm97xx_exit(void)
{
driver_unregister(&wm97xx_driver);
if (IS_BUILTIN(CONFIG_AC97_BUS))
driver_unregister(&wm97xx_driver);
platform_driver_unregister(&wm97xx_mfd_driver);
}

Expand Down

0 comments on commit a3f7c3f

Please sign in to comment.