]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i2c: bpmp-tegra: Ignore unknown I2C_M flags
authorMikko Perttunen <mperttunen@nvidia.com>
Tue, 12 Jan 2021 10:22:25 +0000 (12:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Jan 2021 12:31:12 +0000 (13:31 +0100)
commit bc1c2048abbe3c3074b4de91d213595c57741a6b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-tegra-bpmp.c

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