]> git.baikalelectronics.ru Git - kernel.git/commit
platform/surface: surface3-wmi: Simplify resource management
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 30 Jan 2022 08:36:54 +0000 (09:36 +0100)
committerHans de Goede <hdegoede@redhat.com>
Thu, 3 Feb 2022 10:56:04 +0000 (11:56 +0100)
commitfbad1159941e3f853e96f32a52a46450404416d4
tree1836aae431957c780aa9dcb3d6970dafdd5efaf5
parent9a82380a2459baa829ed980ce01cf847b8406fa1
platform/surface: surface3-wmi: Simplify resource management

's3_wmi.input' is a managed resource, so there should be no need to free it
explicitly.

Moreover, 's3_wmi' is a global variable. 's3_wmi.input' should be NULL
when this error handling path is executed, because it has not been
assigned yet.

All this is puzzling. So simplify it and remove a few lines of code to have
it be more straightforward.

Fixes: c6b306f27b71 ("platform/x86: Add custom surface3 platform device for controlling LID")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/8b1a6d05036d5d9527241b2345482b369331ce5c.1643531799.git.christophe.jaillet@wanadoo.fr
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/surface/surface3-wmi.c