From: Mark Pearson Date: Thu, 1 Jun 2023 20:05:52 +0000 (-0400) Subject: platform/x86: think-lmi: Don't display unnecessary authentication settings X-Git-Tag: v6.6.7~2486^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7def1d35d4b4a92e33fa665ba1a5a02926be9c3c;p=platform%2Fkernel%2Flinux-starfive.git platform/x86: think-lmi: Don't display unnecessary authentication settings 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 Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230601200552.4396-8-mpearson-lenovo@squebb.ca Signed-off-by: Hans de Goede --- diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index 2aaaee8..52d1ce8 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -885,6 +885,11 @@ 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; }