diff mbox series

[4/4] platform/x86: think-lmi: Don't display unnecessary authentication settings

Message ID 20230517181945.3725-4-mpearson-lenovo@squebb.ca (mailing list archive)
State Changes Requested, archived
Headers show
Series [1/4] platform/x86: think-lmi: Enable opcode support on BIOS settings | expand

Commit Message

Mark Pearson May 17, 2023, 6:19 p.m. UTC
If Opcode support is available (which is the standard for all platforms
going forward) then there is no need to have the encoding and kbdlang
attributes visible

Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
---
 drivers/platform/x86/think-lmi.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
index 2d95b1a199fa..46500707f939 100644
--- a/drivers/platform/x86/think-lmi.c
+++ b/drivers/platform/x86/think-lmi.c
@@ -879,6 +879,12 @@  static umode_t auth_attr_is_visible(struct kobject *kobj,
 		return 0;
 	}
 
+	/* Don't display un-needed settings if opcode available */
+	if ((attr == &auth_encoding.attr ||
+	    attr == &auth_kbdlang.attr) &&
+	    tlmi_priv.opcode_support)
+		return 0;
+
 	return attr->mode;
 }