spi: spi-ep93xx: Fix the PTR_ERR() argument
authorFabio Estevam <fabio.estevam@nxp.com>
Tue, 24 May 2016 02:24:21 +0000 (23:24 -0300)
committerMark Brown <broonie@kernel.org>
Tue, 24 May 2016 15:54:50 +0000 (16:54 +0100)
PTR_ERR should access the value just tested by IS_ERR.

The semantic patch that makes this change is available
in scripts/coccinelle/tests/odd_ptr_err.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-ep93xx.c

index bb00be8d185106986dc284cf8a256c0449a740fd..17a6387e20b5fb0f9cf673cfb4cc8e4322ea9fed 100644 (file)
@@ -567,7 +567,7 @@ static void ep93xx_spi_dma_transfer(struct ep93xx_spi *espi)
        txd = ep93xx_spi_dma_prepare(espi, DMA_MEM_TO_DEV);
        if (IS_ERR(txd)) {
                ep93xx_spi_dma_finish(espi, DMA_DEV_TO_MEM);
-               dev_err(&espi->pdev->dev, "DMA TX failed: %ld\n", PTR_ERR(rxd));
+               dev_err(&espi->pdev->dev, "DMA TX failed: %ld\n", PTR_ERR(txd));
                msg->status = PTR_ERR(txd);
                return;
        }