From 496ff31f349ab2d97992bc5f62057486296f1769 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 12 Dec 2024 11:03:22 +0800 Subject: [PATCH] Input: bbnsm_pwrkey - add remove hook BugLink: https://bugs.launchpad.net/bugs/2114239 commit 55b75306c3edf369285ce22ba1ced45e335094c2 upstream. Without remove hook to clear wake irq, there will be kernel dump when doing module test. "bbnsm_pwrkey 44440000.bbnsm:pwrkey: wake irq already initialized" Add remove hook to clear wake irq and set wakeup to false. Signed-off-by: Peng Fan Fixes: 40e40fdfec3f ("Input: bbnsm_pwrkey - add bbnsm power key support") Link: https://lore.kernel.org/r/20241212030322.3110017-1-peng.fan@oss.nxp.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman [nwager: Context change due to missing commit: 2f99ffd8d730 ("Input: bbnsm_pwrkey - fix missed key press after suspend") and use .remove_new instead of .remove due to missing commit: 0edb555a65d1 ("platform: Make platform_driver::remove() return void")] Signed-off-by: Noah Wager Signed-off-by: Mehmet Basaran --- drivers/input/misc/nxp-bbnsm-pwrkey.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/input/misc/nxp-bbnsm-pwrkey.c b/drivers/input/misc/nxp-bbnsm-pwrkey.c index 1d99206dd3a8..d83604990377 100644 --- a/drivers/input/misc/nxp-bbnsm-pwrkey.c +++ b/drivers/input/misc/nxp-bbnsm-pwrkey.c @@ -173,6 +173,12 @@ static int bbnsm_pwrkey_probe(struct platform_device *pdev) return 0; } +static void bbnsm_pwrkey_remove(struct platform_device *pdev) +{ + dev_pm_clear_wake_irq(&pdev->dev); + device_init_wakeup(&pdev->dev, false); +} + static const struct of_device_id bbnsm_pwrkey_ids[] = { { .compatible = "nxp,imx93-bbnsm-pwrkey" }, { /* sentinel */ } @@ -185,6 +191,8 @@ static struct platform_driver bbnsm_pwrkey_driver = { .of_match_table = bbnsm_pwrkey_ids, }, .probe = bbnsm_pwrkey_probe, + .remove_new = bbnsm_pwrkey_remove, + }; module_platform_driver(bbnsm_pwrkey_driver);