]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/surface: platform_profile: Propagate error if profile registration fails
authorArmin Wolf <W_Armin@gmx.de>
Sat, 14 Oct 2023 23:54:49 +0000 (01:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 09:59:03 +0000 (11:59 +0200)
commitc6bbe51dcdf32322fc483b53e60e074b93b475fb
tree271d4468d6a1f4db6dd16f70a98ece19eff11700
parenta73c8d71693838f5c258aa985d3654b2cf6c987c
platform/surface: platform_profile: Propagate error if profile registration fails

commit fe0e04cf66a12ffe6d1b43725ddaabd5599d024f upstream.

If platform_profile_register() fails, the driver does not propagate
the error, but instead probes successfully. This means when the driver
unbinds, the a warning might be issued by platform_profile_remove().

Fix this by propagating the error back to the caller of
surface_platform_profile_probe().

Compile-tested only.

Fixes: b78b4982d763 ("platform/surface: Add platform profile driver")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Tested-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20231014235449.288702-1-W_Armin@gmx.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/surface/surface_platform_profile.c