]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: ideapad-laptop: always propagate error codes from device attributes...
authorBarnabás Pőcze <pobrn@protonmail.com>
Wed, 3 Feb 2021 21:55:48 +0000 (21:55 +0000)
committerHans de Goede <hdegoede@redhat.com>
Thu, 4 Feb 2021 09:21:00 +0000 (10:21 +0100)
commitdf5d6990d9ca45d496f816718f77d38cd09ae8bc
tree474baad763019c3fe57a66ee7d331d3cb8a6cfcb
parentec831bb26e1fb2211a37801368fe947129d40baf
platform/x86: ideapad-laptop: always propagate error codes from device attributes' show() callback

Consumers can differentiate an error from a successful read much more
easily if the read() call fails with an appropriate errno instead of
returning a magic string like "-1". This introduces an ABI change, but
not many users are expected to be relying on the previous behavior,
and this change makes this module conforming to the standard behavior
that sysfs attribute show/store callbacks return an appropriate
errno in case of failure. Thus the ABI breakage is deemed justified.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Link: https://lore.kernel.org/r/20210203215403.290792-15-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