diff mbox series

[V3] Input: bbnsm_pwrkey - add remove hook

Message ID 20241209075733.2504229-1-peng.fan@oss.nxp.com (mailing list archive)
State Superseded
Headers show
Series [V3] Input: bbnsm_pwrkey - add remove hook | expand

Commit Message

Peng Fan Dec. 9, 2024, 7:57 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

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.

Fixes: 40e40fdfec3f ("Input: bbnsm_pwrkey - add bbnsm power key support")
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---

V3:
 I tried to dev_pm_clear_wake_irq in common code, but Greg rejected:
 https://lore.kernel.org/all/2024111213-eradicate-puma-3592@gregkh/
 So post v3 with input_unregister_device dropped

V2:
Per Christophe JAILLET
 Use remove, not remove_new
 Drop checking bbnsm pointer in remove

 drivers/input/misc/nxp-bbnsm-pwrkey.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

kernel test robot Dec. 9, 2024, 8:18 p.m. UTC | #1
Hi Peng,

kernel test robot noticed the following build warnings:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on linus/master v6.13-rc2 next-20241209]
[cannot apply to dtor-input/for-linus]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Peng-Fan-OSS/Input-bbnsm_pwrkey-add-remove-hook/20241209-160051
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
patch link:    https://lore.kernel.org/r/20241209075733.2504229-1-peng.fan%40oss.nxp.com
patch subject: [PATCH V3] Input: bbnsm_pwrkey - add remove hook
config: i386-buildonly-randconfig-001-20241209 (https://download.01.org/0day-ci/archive/20241210/202412100332.9Mo5ZFrm-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241210/202412100332.9Mo5ZFrm-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412100332.9Mo5ZFrm-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/input/misc/nxp-bbnsm-pwrkey.c:192:23: warning: unused variable 'bbnsm' [-Wunused-variable]
     192 |         struct bbnsm_pwrkey *bbnsm = platform_get_drvdata(pdev);
         |                              ^~~~~
   1 warning generated.


vim +/bbnsm +192 drivers/input/misc/nxp-bbnsm-pwrkey.c

   189	
   190	static void bbnsm_pwrkey_remove(struct platform_device *pdev)
   191	{
 > 192		struct bbnsm_pwrkey *bbnsm = platform_get_drvdata(pdev);
   193	
   194		dev_pm_clear_wake_irq(&pdev->dev);
   195		device_init_wakeup(&pdev->dev, false);
   196	}
   197
diff mbox series

Patch

diff --git a/drivers/input/misc/nxp-bbnsm-pwrkey.c b/drivers/input/misc/nxp-bbnsm-pwrkey.c
index eb4173f9c820..63818956e376 100644
--- a/drivers/input/misc/nxp-bbnsm-pwrkey.c
+++ b/drivers/input/misc/nxp-bbnsm-pwrkey.c
@@ -187,6 +187,14 @@  static int bbnsm_pwrkey_probe(struct platform_device *pdev)
 	return 0;
 }
 
+static void bbnsm_pwrkey_remove(struct platform_device *pdev)
+{
+	struct bbnsm_pwrkey *bbnsm = platform_get_drvdata(pdev);
+
+	dev_pm_clear_wake_irq(&pdev->dev);
+	device_init_wakeup(&pdev->dev, false);
+}
+
 static int __maybe_unused bbnsm_pwrkey_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -223,6 +231,8 @@  static struct platform_driver bbnsm_pwrkey_driver = {
 		.of_match_table = bbnsm_pwrkey_ids,
 	},
 	.probe = bbnsm_pwrkey_probe,
+	.remove = bbnsm_pwrkey_remove,
+
 };
 module_platform_driver(bbnsm_pwrkey_driver);