Blob Blame History Raw
From b68f8a13e3b4bd2f956250cd428fee344f4d60a3 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 23 Nov 2021 22:04:19 +0100
Subject: [PATCH] platform/x86: thinkpad_acpi: Restore missing hotkey_tablet_mode and hotkey_radio_sw sysfs-attr
Git-commit: b68f8a13e3b4bd2f956250cd428fee344f4d60a3
Alt-commit: 910524004383863bb1d2888e510dd61fd00119d0
Patch-mainline: v5.16-rc5
References: bsc#1210050

Commit c99ca78d67a6 ("platform/x86: thinkpad_acpi: Switch to common use
of attributes") removed the conditional adding of the
hotkey_tablet_mode and hotkey_radio_sw sysfs-attributes, replacing this
with a hotkey_attr_is_visible() callback which hides them when the
feature is not present.

But this commit forgot to add these 2 attributes to the default
hotkey_attributes[] set, so they would now never get added at all.

Add the 2 attributes to the default hotkey_attributes[] set so that
they are available on systems with these features once more.

Fixes: c99ca78d67a6 ("platform/x86: thinkpad_acpi: Switch to common use of attributes")
Cc: Len Baker <len.baker@gmx.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211123210424.266607-2-hdegoede@redhat.com
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/platform/x86/thinkpad_acpi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index b3ac9c3f3b7c..17d581e21e7f 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3015,6 +3015,8 @@ static struct attribute *hotkey_attributes[] = {
 	&dev_attr_hotkey_all_mask.attr,
 	&dev_attr_hotkey_adaptive_all_mask.attr,
 	&dev_attr_hotkey_recommended_mask.attr,
+	&dev_attr_hotkey_tablet_mode.attr,
+	&dev_attr_hotkey_radio_sw.attr,
 #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
 	&dev_attr_hotkey_source_mask.attr,
 	&dev_attr_hotkey_poll_freq.attr,
-- 
2.35.3