[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <c522fb84-20cd-39e6-bd2d-79ed8709fd5d@infradead.org>
Date: Sat, 13 Oct 2018 10:06:18 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: LKML <linux-kernel@...r.kernel.org>,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>
Cc: Robert Jarzmik <robert.jarzmik@...e.fr>,
Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Mark Brown <broonie@...nel.org>, patches@...nsource.cirrus.com
Subject: [PATCH] input: touchscreen: fix wm97xx-ts exit path
From: Randy Dunlap <rdunlap@...radead.org>
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: ae9d1b5fbd7b ("Input: wm97xx: add new AC97 bus support")
Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
Cc: Robert Jarzmik <robert.jarzmik@...e.fr>
Cc: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Mark Brown <broonie@...nel.org>
Cc: patches@...nsource.cirrus.com
Cc: linux-input@...r.kernel.org
---
drivers/input/touchscreen/wm97xx-core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- lnx-419-rc7.orig/drivers/input/touchscreen/wm97xx-core.c
+++ lnx-419-rc7/drivers/input/touchscreen/wm97xx-core.c
@@ -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);
}
Powered by blists - more mailing lists