linux-stable/drivers/platform/surface
Francesco Dolcini d849cf64c5 platform/surface: aggregator: fix recv_buf() return value
commit c8820c92ca upstream.

Serdev recv_buf() callback is supposed to return the amount of bytes
consumed, therefore an int in between 0 and count.

Do not return negative number in case of issue, when
ssam_controller_receive_buf() returns ESHUTDOWN just returns 0, e.g. no
bytes consumed, this keep the exact same behavior as it was before.

This fixes a potential WARN in serdev-ttyport.c:ttyport_receive_buf().

Fixes: c167b9c7e3 ("platform/surface: Add Surface Aggregator subsystem")
Cc: stable@vger.kernel.org
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20231128194935.11350-1-francesco@dolcini.it
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-13 18:36:44 +01:00
..
aggregator platform/surface: aggregator: fix recv_buf() return value 2023-12-13 18:36:44 +01:00
Kconfig
Makefile
surface3-wmi.c
surface3_button.c
surface3_power.c
surface_acpi_notify.c
surface_aggregator_cdev.c
surface_aggregator_registry.c platform/surface: aggregator_registry: Add support for Surface Laptop Go 2 2022-09-20 12:39:43 +02:00
surface_dtx.c
surface_gpe.c
surface_hotplug.c
surface_platform_profile.c platform/surface: platform_profile: Propagate error if profile registration fails 2023-10-25 11:59:03 +02:00
surfacepro3_button.c