lkml.org 
[lkml]   [2022]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Input: spear-keyboard - Simplify resource management
On Sun, Jan 30, 2022 at 09:20:44AM +0100, Christophe JAILLET wrote:
> Since the commit in the Fixes tag below, 'kbd->input' is a managed resource
> that doesn't need to be explicitly unregistered or freed (see
> devm_input_allocate_device() documentation)
>
> So, remove a unless line of code to slightly simplify it.
>
> Fixes: 6102752eb354 ("Input: spear-keyboard - switch to using managed resources")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Compile tested only
> ---
> drivers/input/keyboard/spear-keyboard.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
> index 9838c79cb288..c36836159fb3 100644
> --- a/drivers/input/keyboard/spear-keyboard.c
> +++ b/drivers/input/keyboard/spear-keyboard.c
> @@ -278,7 +278,6 @@ static int spear_kbd_remove(struct platform_device *pdev)
> {
> struct spear_kbd *kbd = platform_get_drvdata(pdev);
>
> - input_unregister_device(kbd->input);
> clk_unprepare(kbd->clk);

This is wrong for the same reason as the other patch: it changes the
order of operations.

>
> return 0;
> --
> 2.32.0
>

Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2022-01-31 17:15    [W:0.032 / U:2.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site