[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fad1d01f-0ae4-4d82-afff-64a53dd4767c@gmail.com>
Date: Sun, 15 Oct 2023 21:06:11 +0200
From: Maximilian Luz <luzmaximilian@...il.com>
To: Armin Wolf <W_Armin@....de>
Cc: hdegoede@...hat.com, ilpo.jarvinen@...ux.intel.com,
markgross@...nel.org, platform-driver-x86@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] platform/surface: platform_profile: Propagate error if
profile registration fails
On 10/15/23 01:54, Armin Wolf wrote:
> 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@....de>
Thanks! Works fine on my Surface Book 2.
Reviewed-by: Maximilian Luz <luzmaximilian@...il.com>
Tested-by: Maximilian Luz <luzmaximilian@...il.com>
> ---
> drivers/platform/surface/surface_platform_profile.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/platform/surface/surface_platform_profile.c b/drivers/platform/surface/surface_platform_profile.c
> index f433a13c3689..a5a3941b3f43 100644
> --- a/drivers/platform/surface/surface_platform_profile.c
> +++ b/drivers/platform/surface/surface_platform_profile.c
> @@ -159,8 +159,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)
> set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, tpd->handler.choices);
> set_bit(PLATFORM_PROFILE_PERFORMANCE, tpd->handler.choices);
>
> - platform_profile_register(&tpd->handler);
> - return 0;
> + return platform_profile_register(&tpd->handler);
> }
>
> static void surface_platform_profile_remove(struct ssam_device *sdev)
> --
> 2.39.2
>
Powered by blists - more mailing lists