Skip to content

Commit fe0e04c

Browse files
Wer-Wolfjwrdegoede
authored andcommitted
platform/surface: platform_profile: Propagate error if profile registration 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 <[email protected]> Reviewed-by: Maximilian Luz <[email protected]> Tested-by: Maximilian Luz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
1 parent 235985d commit fe0e04c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/platform/surface/surface_platform_profile.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)
159159
set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, tpd->handler.choices);
160160
set_bit(PLATFORM_PROFILE_PERFORMANCE, tpd->handler.choices);
161161

162-
platform_profile_register(&tpd->handler);
163-
return 0;
162+
return platform_profile_register(&tpd->handler);
164163
}
165164

166165
static void surface_platform_profile_remove(struct ssam_device *sdev)

0 commit comments

Comments
 (0)