Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7dba42c authored by Randy Dunlap's avatar Randy Dunlap Committed by Greg Kroah-Hartman
Browse files

Input: wm97xx-ts - fix exit path



[ Upstream commit a3f7c3fcf60868c1e90671df5d0cf9be5900a09b ]

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: ae9d1b5f ("Input: wm97xx: add new AC97 bus support")

Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 139dde1e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -929,6 +929,7 @@ static int __init wm97xx_init(void)

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