]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: panasonic-laptop: Return errno correctly in show callback
authorYao Zi <ziyao@disroot.org>
Mon, 18 Nov 2024 06:46:39 +0000 (06:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:51 +0000 (19:50 +0100)
commit38c3f8acde76230eacb642ef73f792f5edb81f82
treef9d4e74f310aeb9645eacf1376dbf79d5a4e0f19
parent0f7f31aaf61321cce092c8a7d440c0028599fb55
platform/x86: panasonic-laptop: Return errno correctly in show callback

[ Upstream commit 5c7bebc1a3f0661db558d60e14dde27fc216d9dc ]

When an error occurs in sysfs show callback, we should return the errno
directly instead of formatting it as the result, which produces
meaningless output and doesn't inform the userspace of the error.

Fixes: 468f96bfa3a0 ("platform/x86: panasonic-laptop: Add support for battery charging threshold (eco mode)")
Fixes: d5a81d8e864b ("platform/x86: panasonic-laptop: Add support for optical driver power in Y and W series")
Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241118064637.61832-3-ziyao@disroot.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/panasonic-laptop.c