Skip to content

Commit 8e8895c

Browse files
flukejonesjwrdegoede
authored andcommitted
platform/x86: asus-wmi: don't fail if platform_profile already registered
On some newer laptops ASUS laptops SPS support is advertised but not actually used, causing the AMD driver to register as a platform_profile handler. If this happens then the asus_wmi driver would error with -EEXIST when trying to register its own handler leaving the user with a possibly unusable system. This is especially true for laptops with an MCU that emit a stream of HID packets, some of which can be misinterpreted as shutdown signals. We can safely continue loading the driver instead of bombing out. Signed-off-by: Luke D. Jones <luke@ljones.dev> Link: https://lore.kernel.org/r/20240910045443.678145-1-luke@ljones.dev Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent f965e5b commit 8e8895c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/platform/x86/asus-wmi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3910,8 +3910,13 @@ static int platform_profile_setup(struct asus_wmi *asus)
39103910
asus->platform_profile_handler.choices);
39113911

39123912
err = platform_profile_register(&asus->platform_profile_handler);
3913-
if (err)
3913+
if (err == -EEXIST) {
3914+
pr_warn("%s, a platform_profile handler is already registered\n", __func__);
3915+
return 0;
3916+
} else if (err) {
3917+
pr_err("%s, failed at platform_profile_register: %d\n", __func__, err);
39143918
return err;
3919+
}
39153920

39163921
asus->platform_profile_support = true;
39173922
return 0;

0 commit comments

Comments
 (0)