]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i2c: qcom-geni: Use the correct return value
authorBjorn Andersson <bjorn.andersson@linaro.org>
Sun, 17 Jul 2022 03:50:25 +0000 (20:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:41:11 +0000 (14:41 +0200)
[ Upstream commit b3f0ceb7c2037c6e3affd7d9c84ac5f97af7a5b5 ]

The introduction of GPI support moved things around and instead of
returning the result from geni_i2c_xfer() the number of messages in the
request was returned, ignoring the actual result. Fix this.

Fixes: d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-qcom-geni.c

index 5b920f0fc7dd79c5033d3182cbbc27f46e0bdb64..a4eef8de054ce84eba02570c661aa9df5c7546d7 100644 (file)
@@ -688,7 +688,7 @@ static int geni_i2c_xfer(struct i2c_adapter *adap,
        pm_runtime_put_autosuspend(gi2c->se.dev);
        gi2c->cur = NULL;
        gi2c->err = 0;
-       return num;
+       return ret;
 }
 
 static u32 geni_i2c_func(struct i2c_adapter *adap)