diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-11-17 13:19:41 +0300 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-11-30 14:39:24 +0300 |
commit | 463e48fa544826898791085508459de246fc4c09 (patch) | |
tree | c3818692ad04786743c9ba0185515226c2e9d11e /drivers/thunderbolt | |
parent | b658eb9d9075aa2b44834962a1efc4bc78e9bed8 (diff) | |
download | linux-463e48fa544826898791085508459de246fc4c09.tar.xz |
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 <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r-- | drivers/thunderbolt/ctl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 1d86e27a0ef3..bac08b820015 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; } |