Skip to content

Commit

Permalink
platform/surface: platform_profile: Propagate error if profile regist…
Browse files Browse the repository at this point in the history
…ration fails

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: b78b498 ("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>
  • Loading branch information
Armin Wolf authored and Hans de Goede committed Oct 18, 2023
1 parent 235985d commit fe0e04c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/platform/surface/surface_platform_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fe0e04c

Please sign in to comment.