From patchwork Sat Dec 14 04:42:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3344601 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9D3B8C0D4A for ; Sat, 14 Dec 2013 04:43:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9C7620774 for ; Sat, 14 Dec 2013 04:42:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA1F320772 for ; Sat, 14 Dec 2013 04:42:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962Ab3LNEmx (ORCPT ); Fri, 13 Dec 2013 23:42:53 -0500 Received: from mail-bk0-f41.google.com ([209.85.214.41]:61659 "EHLO mail-bk0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751942Ab3LNEmx (ORCPT ); Fri, 13 Dec 2013 23:42:53 -0500 Received: by mail-bk0-f41.google.com with SMTP id v15so1667429bkz.14 for ; Fri, 13 Dec 2013 20:42:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=sWfxUAjPJ2qDID8JEX1Y40yLa4twTXPz4QH04eMdb54=; b=rAyu1hvwBWz6ANem3or5iY8cHr3QOQFOJHRm1X7N6Iw6LBk2RzJh4EeV+DwGhalZ8m AtYN4bhBEsOwPOxX/VBrCWWXNkiloLOhi9TUMsOmEkUe8z/IBP+LcMIlu9pn6+ZgNYFq /jGxzvCnTIcqab0FexLJ9xxAgNUOr5p+j1FfIk5bI8E7T7G7YWsTgC2Gb5URHRhusDUo AhS27eVbaaEcZAIuXrsZc2JPv5w8ysXW9uODsqawdkEt4FBLG236fiSlxhtMlb5CayV7 UpBVC5IivNx+58a3Uds6CDyBaozThzNJvbYgz3d6ZRYnfQFKGaOGEb/oARYbUM0zXB5C OBjg== MIME-Version: 1.0 X-Received: by 10.205.43.200 with SMTP id ud8mr1312995bkb.39.1386996171481; Fri, 13 Dec 2013 20:42:51 -0800 (PST) Received: by 10.204.74.130 with HTTP; Fri, 13 Dec 2013 20:42:51 -0800 (PST) Date: Sat, 14 Dec 2013 12:42:51 +0800 Message-ID: Subject: [PATCH -next] spi: tegra20-slink: fix return value check in tegra_slink_init_dma_param() From: Wei Yongjun To: ldewangan@nvidia.com, broonie@kernel.org, swarren@wwwdotorg.org, thierry.reding@gmail.com, grant.likely@linaro.org, robh+dt@kernel.org Cc: yongjun_wei@trendmicro.com.cn, linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function dma_request_slave_channel() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/spi/spi-tegra20-slink.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index 1e61e98..3643178 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c @@ -614,12 +614,9 @@ static int tegra_slink_init_dma_param(struct tegra_slink_data *tspi, dma_chan = dma_request_slave_channel(tspi->dev, dma_to_memory ? "rx" : "tx"); - if (IS_ERR(dma_chan)) { - ret = PTR_ERR(dma_chan); - if (ret != -EPROBE_DEFER) - dev_err(tspi->dev, - "Dma channel is not available: %d\n", ret); - return ret; + if (!dma_chan) { + dev_err(tspi->dev, "Dma channel is not available: %d\n", ret); + return -ENODEV; } dma_buf = dma_alloc_coherent(tspi->dev, tspi->dma_buf_size,