linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>, Frank Li <Frank.Li@nxp.com>,
	Jacky Bai <ping.bai@nxp.com>, Jason Liu <jason.hui.liu@nxp.com>,
	"open list:INPUT (KEYBOARD, MOUSE, JOYSTICK,
	TOUCHSCREEN)..." <linux-input@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH V2] Input: bbnsm_pwrkey - add remove hook
Date: Mon, 4 Nov 2024 21:48:44 -0800	[thread overview]
Message-ID: <ZymxvLMkkktRoCXZ@google.com> (raw)
In-Reply-To: <20241104031552.3475108-1-peng.fan@oss.nxp.com>

Hi Peng,

On Mon, Nov 04, 2024 at 11:15:51AM +0800, Peng Fan (OSS) wrote:
> 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>
> ---
> 
> V2:
>  Per Christophe JAILLET
>   Use remove, not remove_new
>   Drop checking bbnsm pointer in remove
> 
>  drivers/input/misc/nxp-bbnsm-pwrkey.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/input/misc/nxp-bbnsm-pwrkey.c b/drivers/input/misc/nxp-bbnsm-pwrkey.c
> index eb4173f9c820..f0bf119309dd 100644
> --- a/drivers/input/misc/nxp-bbnsm-pwrkey.c
> +++ b/drivers/input/misc/nxp-bbnsm-pwrkey.c
> @@ -187,6 +187,16 @@ 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);

I wonder, could we have this done in the driver core instead of
individual drivers?

> +	device_init_wakeup(&pdev->dev, false);
> +
> +	input_unregister_device(bbnsm->input);

No need to call unregister here, it should happen automatically.

Thanks.

-- 
Dmitry

  reply	other threads:[~2024-11-05  5:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04  3:15 [PATCH V2] Input: bbnsm_pwrkey - add remove hook Peng Fan (OSS)
2024-11-05  5:48 ` Dmitry Torokhov [this message]
2024-11-05 15:09   ` Peng Fan

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=ZymxvLMkkktRoCXZ@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=Frank.Li@nxp.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=jason.hui.liu@nxp.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=ping.bai@nxp.com \
    /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).