i2c: pmcmsp: fix error return from master_xfer
authorPeter Rosin <peda@axentia.se>
Wed, 9 May 2018 19:46:30 +0000 (21:46 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 15 May 2018 07:31:19 +0000 (09:31 +0200)
Returning -1 (-EPERM) is not appropriate here, go with -EIO.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Fixes: 1b144df1d7d6 ("i2c: New PMC MSP71xx TWI bus driver")
drivers/i2c/busses/i2c-pmcmsp.c

index ec27e27e8d068fae16ea8cf80bb1e94a18142286..dae8ac618a5221fdd886afab417f88945af7f143 100644 (file)
@@ -564,7 +564,7 @@ static int pmcmsptwi_master_xfer(struct i2c_adapter *adap,
                 * TODO: We could potentially loop and retry in the case
                 * of MSP_TWI_XFER_TIMEOUT.
                 */
-               return -1;
+               return -EIO;
        }
 
        return num;