public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Sachin Kamat <sachin.kamat@linaro.org>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: samsung-keypad - Simplify resource management
Date: Mon, 31 Jan 2022 08:14:09 -0800	[thread overview]
Message-ID: <YfgK0RPYbXSJ8fJ9@google.com> (raw)
In-Reply-To: <8877b9db412fbeb3b43ba4a3ff6c4b39a5440c70.1643530436.git.christophe.jaillet@wanadoo.fr>

Hi Christophe,

On Sun, Jan 30, 2022 at 09:14:08AM +0100, Christophe JAILLET wrote:
> Since the commit in the Fixes tag below, 'keypad->input_dev' is a managed
> resource that doesn't need to be explicitly unregistered or freed (see
> devm_input_allocate_device() documentation)
> 
> So, remove some unless line of code to slightly simplify it.
> 
> Fixes: a57da3479545 ("Input: samsung-keypad - switch to using managed resources")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Compile tested only
> ---
>  drivers/input/keyboard/samsung-keypad.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
> index df0258dcf89e..b6c3c6399b2e 100644
> --- a/drivers/input/keyboard/samsung-keypad.c
> +++ b/drivers/input/keyboard/samsung-keypad.c
> @@ -451,8 +451,6 @@ static int samsung_keypad_remove(struct platform_device *pdev)
>  
>  	pm_runtime_disable(&pdev->dev);
>  
> -	input_unregister_device(keypad->input_dev);
> -

This is wrong; the order of operations is important and you do not want
to call clk_enable/disable on an unprepared clock.

If you want to do this you need to also replace clk_prepare/unprepare
with devm_ variant.

>  	clk_unprepare(keypad->clk);
>  
>  	return 0;
> -- 
> 2.32.0
> 

Thanks.

-- 
Dmitry

      reply	other threads:[~2022-01-31 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30  8:14 [PATCH] Input: samsung-keypad - Simplify resource management Christophe JAILLET
2022-01-31 16:14 ` Dmitry Torokhov [this message]

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=YfgK0RPYbXSJ8fJ9@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sachin.kamat@linaro.org \
    /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