]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: typec: ucsi: Remove useless error check from ucsi_read_error()
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fri, 16 Aug 2024 13:58:59 +0000 (16:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Aug 2024 10:47:39 +0000 (18:47 +0800)
If the GET_ERROR_STATUS command fails, ucsi_read_error() can
not reach the condition where the CCI error bit is checked,
because ucsi_run_command() has already checked that bit and
returned an error.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240816135859.3499351-7-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c

index 8be10a207121292389e6ff4ec459669656374bed..f0b5867048e252359e047abf0132d4ae973493ae 100644 (file)
@@ -148,9 +148,6 @@ static int ucsi_read_error(struct ucsi *ucsi, u8 connector_num)
        if (ret < 0)
                return ret;
 
-       if (cci & UCSI_CCI_ERROR)
-               return -EIO;
-
        switch (error) {
        case UCSI_ERROR_INCOMPATIBLE_PARTNER:
                return -EOPNOTSUPP;