From patchwork Thu Jan 12 02:18:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9511807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50E2860710 for ; Thu, 12 Jan 2017 02:18:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 451732868C for ; Thu, 12 Jan 2017 02:18:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39CD528699; Thu, 12 Jan 2017 02:18:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D06F9286A4 for ; Thu, 12 Jan 2017 02:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936223AbdALCSx (ORCPT ); Wed, 11 Jan 2017 21:18:53 -0500 Received: from mail-pf0-f181.google.com ([209.85.192.181]:33199 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936022AbdALCSw (ORCPT ); Wed, 11 Jan 2017 21:18:52 -0500 Received: by mail-pf0-f181.google.com with SMTP id y143so4024809pfb.0 for ; Wed, 11 Jan 2017 18:18:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6ylKVwqWndISsaOtZpcftpUyOufk/MKX3FhaKR1dCtI=; b=q1J92Bkn3d5ytUCIw5tr0Xxtn8KtSarVZjBgLrdsp/xlKp80tm/IY7wgDuexwlRS67 MICVvioZJ5TTybMeLrdVq08972PfXSBcXxbySnGUYnt1BrV3UziT/Gvzy1kb/7iKN2eV y15zUeekXR24MCUZzvyDJzSu6p1inoophhBm55bViatJLasyLxsFdsrKX/2nAbTGaHcE hdvIbw/84kMA6P+J1R4YFryImf12FbSuee5EQJhzMtYCenDiDm6msxC7Cy+UlZfNEyU+ 8i6YE+OKdJcpVR9J0Ni2xJ196Dgd96iEmCaZ1Ttre13w4E8akQkxvovyF+/0sLsAJMQY jD1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6ylKVwqWndISsaOtZpcftpUyOufk/MKX3FhaKR1dCtI=; b=KK/BUN+zsEj3jL6Ju5NWpEzywZmwp3KBg0AnxWTxUcskPFSq1Hj2hrEwKZqjYAwKO/ jTetOt3GAOMyPxuQVsS2TkiF8KxzpvcmrQfTX80KIPSTe3es7wwAz4WQlkv7ogJrqsk8 QKzika/pz2DloZ4NldxuAaQ6qKFsj8BoHT4Ka92xE+brTEBZJO3tgCMvFlgrpQD+vDlY dDGXzqenVj1lYn8LYB5493nWxJK2lOXbpklLnCYRxEuob1CYmyT2ckCuQsp3UGue8TuK I2FiyyWXoybfReMm9BlQFL9S6Z3GjoSj5ObBlxb3ktUXT/fyxwbujAYqIXzZSSAT/3/J NFqg== X-Gm-Message-State: AIkVDXKyqK8P6KXFn07bpWZXZO6wYMqiAnnIOSrwz/95fRfam/LyFIWroDsGX4HL2iZ9BCPL X-Received: by 10.98.223.195 with SMTP id d64mr13847390pfl.80.1484187521632; Wed, 11 Jan 2017 18:18:41 -0800 (PST) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id s64sm178372pfe.27.2017.01.11.18.18.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 18:18:41 -0800 (PST) From: Kevin Hilman To: Mark Brown Cc: Sekhar Nori , Axel Haslam , =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= , Alexandre Bailon , David Lechner , Patrick Titiano , Fabien Parent , linux-spi@vger.kernel.org (open list:SPI SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] spi: davinci: use dma_mapping_error() Date: Wed, 11 Jan 2017 18:18:40 -0800 Message-Id: <20170112021840.21105-1-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The correct error checking for dma_map_single() is to use dma_mapping_error(). Signed-off-by: Kevin Hilman --- Applies to v4.10-rc3 drivers/spi/spi-davinci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index d36c11b73a35..02fb96797ac8 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -646,7 +646,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) buf = t->rx_buf; t->rx_dma = dma_map_single(&spi->dev, buf, t->len, DMA_FROM_DEVICE); - if (!t->rx_dma) { + if (dma_mapping_error(&spi->dev, !t->rx_dma)) { ret = -EFAULT; goto err_rx_map; } @@ -660,7 +660,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) buf = (void *)t->tx_buf; t->tx_dma = dma_map_single(&spi->dev, buf, t->len, DMA_TO_DEVICE); - if (!t->tx_dma) { + if (dma_mapping_error(&spi->dev, t->tx_dma)) { ret = -EFAULT; goto err_tx_map; }