From: Mika Westerberg Date: Tue, 17 Nov 2020 10:19:41 +0000 (+0300) Subject: thunderbolt: Return -ENOTCONN when ERR_CONN is received X-Git-Tag: accepted/tizen/unified/20230118.172025~8319^2~39^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=463e48fa544826898791085508459de246fc4c09;p=platform%2Fkernel%2Flinux-rpi.git thunderbolt: Return -ENOTCONN when ERR_CONN is received This allows the calling code to distinguish if the error was due to ERR_CONN (adapter is disconneced or disabled) or something else. Will be needed in USB4 router NVM update in the following patch. Signed-off-by: Mika Westerberg --- diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 1d86e27..bac08b8 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -962,6 +962,9 @@ static int tb_cfg_get_error(struct tb_ctl *ctl, enum tb_cfg_space space, if (res->tb_error == TB_CFG_ERROR_LOCK) return -EACCES; + else if (res->tb_error == TB_CFG_ERROR_PORT_NOT_CONNECTED) + return -ENOTCONN; + return -EIO; }