From: Randy Dunlap <rdunlap@infradead.org>
To: LKML <linux-kernel@vger.kernel.org>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Mark Brown <broonie@kernel.org>,
patches@opensource.cirrus.com
Subject: [PATCH] input: touchscreen: fix wm97xx-ts exit path
Date: Sat, 13 Oct 2018 10:06:18 -0700 [thread overview]
Message-ID: <c522fb84-20cd-39e6-bd2d-79ed8709fd5d@infradead.org> (raw)
From: Randy Dunlap <rdunlap@infradead.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@infradead.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: patches@opensource.cirrus.com
Cc: linux-input@vger.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);
}
next reply other threads:[~2018-10-13 17:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-13 17:06 Randy Dunlap [this message]
2018-10-15 18:17 ` [PATCH] input: touchscreen: fix wm97xx-ts exit path Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c522fb84-20cd-39e6-bd2d-79ed8709fd5d@infradead.org \
--to=rdunlap@infradead.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=robert.jarzmik@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).