]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups
authorLen Baker <len.baker@gmx.com>
Sat, 23 Oct 2021 15:40:36 +0000 (17:40 +0200)
committerHans de Goede <hdegoede@redhat.com>
Tue, 16 Nov 2021 09:56:53 +0000 (10:56 +0100)
commit13f9bfcda4e6b66c5b5b1a862a0dd4d8b1b61ceb
treec6d108aad3d0bcdf7623b83876cca98064ad83b3
parent9a032267ca61629815bddb99d96599188129c615
platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups

Platform drivers have the option of having the platform core create and
remove any needed sysfs attribute files. So take advantage of that and
refactor the attributes management to avoid to register them "by hand".

Also, due to some attributes are optionals, refactor the code and move
the logic inside the "is_visible" callbacks of the attribute_group
structures.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20211023154036.6800-1-len.baker@gmx.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/thinkpad_acpi.c