From: Heikki Krogerus Date: Fri, 9 Aug 2024 15:03:43 +0000 (+0300) Subject: usb: typec: ucsi: Fix the return value of ucsi_run_command() X-Git-Tag: v6.11-rc4~4^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d209d1634e6562eafc369b28f8a1f67a2e9e5222;p=thirdparty%2Fkernel%2Flinux.git usb: typec: ucsi: Fix the return value of ucsi_run_command() The command execution routines need to return the amount of data that was transferred when succesful. This fixes an issue where the alternate modes and the power delivery capabilities are not getting registered. Fixes: 5e9c1662a89b ("usb: typec: ucsi: rework command execution functions") Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20240809150343.286942-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 432a2d6266d71..4039851551c1b 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -137,7 +137,7 @@ static int ucsi_run_command(struct ucsi *ucsi, u64 command, u32 *cci, if (ret) return ret; - return err; + return err ?: UCSI_CCI_LENGTH(*cci); } static int ucsi_read_error(struct ucsi *ucsi, u8 connector_num)