Skip to contentSkip to conversation

i2c: qcom-geni: remove unnecessary conditions

PATCH Applied Dan Carpenter 2 participants 2 messages Mar 7, 2022 – May 21, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: qcom-geni: remove unnecessary conditions

We know that "ret" is a negative error code at this point so there is no need to check.

---
 drivers/i2c/busses/i2c-qcom-geni.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-qcom-geni.c +2 -4
index fc1dcc19f2a1..17915c98c2c4 100644
@@ -727,16 +727,14 @@ static int setup_gpi_dma(struct geni_i2c_dev *gi2c)
 	if (IS_ERR(gi2c->tx_c)) {
 		ret = dev_err_probe(gi2c->se.dev, PTR_ERR(gi2c->tx_c),
 				    "Failed to get tx DMA ch\n");
-		if (ret < 0)
-			goto err_tx;
+		goto err_tx;
 	}
 
 	gi2c->rx_c = dma_request_chan(gi2c->se.dev, "rx");
 	if (IS_ERR(gi2c->rx_c)) {
 		ret = dev_err_probe(gi2c->se.dev, PTR_ERR(gi2c->rx_c),
 				    "Failed to get rx DMA ch\n");
-		if (ret < 0)
-			goto err_rx;
+		goto err_rx;
 	}
 
 	dev_dbg(gi2c->se.dev, "Grabbed GPI dma channels\n");
Signature · 1 line
2.20.1