platform/x86: ideapad-laptop: misc. device attribute changes
authorBarnabás Pőcze <pobrn@protonmail.com>
Wed, 3 Feb 2021 21:55:53 +0000 (21:55 +0000)
committerHans de Goede <hdegoede@redhat.com>
Thu, 4 Feb 2021 09:21:04 +0000 (10:21 +0100)
commit00641c086d2d929a770afcd8d637655625664eae
treee131b3b3964a4ea25dee2abba3164a0af18ed7a0
parentc81f241081b8dd6796d9f29fb4f264aa997311cb
platform/x86: ideapad-laptop: misc. device attribute changes

Do not handle zero length buffer separately. Use kstrtouint() instead
of sscanf(). Use kstrtobool() in store_ideapad_cam(). These
introduce minor ABI changes, but it is expected that no users rely
on the previous behavior. Thus the change is deemed justifed.
Additionally, use `!!` to convert to `int` and use the "%d" format
specifier in sysfs_emit() for boolean-like attributes.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Link: https://lore.kernel.org/r/20210203215403.290792-16-pobrn@protonmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/ideapad-laptop.c