platform/x86: think-lmi: Move pending_reboot_attr to the attributes sysfs dir
authorMark Pearson <markpearson@lenovo.com>
Sat, 17 Jul 2021 14:36:05 +0000 (16:36 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 17 Jul 2021 14:39:55 +0000 (16:39 +0200)
commite62fb1e3faae60f483a96c359c8d72bb04a7b728
tree98d1d0bb63bac46a58a98052427674998e004abd
parent7f5231b114da76bfd5d0fc685d5cf408d1bbfca7
platform/x86: think-lmi: Move pending_reboot_attr to the attributes sysfs dir

Move the pending_reboot node under attributes dir where it should live, as
documented in: Documentation/ABI/testing/sysfs-class-firmware-attributes.

Also move the create / remove code to be together with the other code
populating / cleaning the attributes sysfs dir. In the removal path this
is necessary so that the remove is done before the
kset_unregister(tlmi_priv.attribute_kset) call.

Signed-off-by: Mark Pearson <markpearson@lenovo.com>
Co-developed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210717143607.3580-1-hdegoede@redhat.com
drivers/platform/x86/think-lmi.c