]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit9266d7a81e5a047d77e9ff03c93d142b0947b371
treee131b3b3964a4ea25dee2abba3164a0af18ed7a0
parentdf5d6990d9ca45d496f816718f77d38cd09ae8bc
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