]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
i2c: imx: Fix inconsistent IS_ERR and PTR_ERR in i2c_imx_dma_request()
authorYueHaibing <yuehaibing@huawei.com>
Thu, 17 Jan 2019 03:14:54 +0000 (03:14 +0000)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 22 Jan 2019 22:53:03 +0000 (23:53 +0100)
Change the call to PTR_ERR to access the value just tested by IS_ERR.

Fixes: 5b3a23a3cc94 ("i2c: imx: notify about real errors on dma i2c_imx_dma_request")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Esben Haabendal <esben@haabendal.dk>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-imx.c

index 09b12454766956aef6ae7ffe2e6a22c8bb2d31f2..42fed40198a0fb77981e90236c465c9a12bff218 100644 (file)
@@ -287,7 +287,7 @@ static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 
        dma->chan_tx = dma_request_chan(dev, "tx");
        if (IS_ERR(dma->chan_tx)) {
-               ret = PTR_ERR(dma->chan_rx);
+               ret = PTR_ERR(dma->chan_tx);
                if (ret != -ENODEV && ret != -EPROBE_DEFER)
                        dev_err(dev, "can't request DMA tx channel (%d)\n", ret);
                goto fail_al;