i2c: rcar: use proper device with dma_mapping_error
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 24 Aug 2016 09:19:29 +0000 (11:19 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 25 Aug 2016 16:48:47 +0000 (18:48 +0200)
We must use the same device we used for mapping.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-rcar.c

index 52407f3..9bd849d 100644 (file)
@@ -378,7 +378,7 @@ static void rcar_i2c_dma(struct rcar_i2c_priv *priv)
        }
 
        dma_addr = dma_map_single(chan->device->dev, buf, len, dir);
-       if (dma_mapping_error(dev, dma_addr)) {
+       if (dma_mapping_error(chan->device->dev, dma_addr)) {
                dev_dbg(dev, "dma map failed, using PIO\n");
                return;
        }