i2c: bpmp-tegra: Ignore unknown I2C_M flags
authorMikko Perttunen <mperttunen@nvidia.com>
Tue, 12 Jan 2021 10:22:25 +0000 (12:22 +0200)
committerWolfram Sang <wsa@kernel.org>
Sun, 17 Jan 2021 11:17:11 +0000 (12:17 +0100)
In order to not to start returning errors when new I2C_M flags are
added, change behavior to just ignore all flags that we don't know
about. This includes the I2C_M_DMA_SAFE flag that already exists but
causes -EINVAL to be returned for valid transactions.

Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-tegra-bpmp.c

index ec7a7e917eddb2ce94b65f97f4c2b813a64ee45f..c0c7d01473f2ba110553c0349e10ca6b03dbb7ca 100644 (file)
@@ -80,7 +80,7 @@ static int tegra_bpmp_xlate_flags(u16 flags, u16 *out)
                flags &= ~I2C_M_RECV_LEN;
        }
 
-       return (flags != 0) ? -EINVAL : 0;
+       return 0;
 }
 
 /**