From patchwork Fri Aug 23 00:33:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2848482 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC4769F2F6 for ; Fri, 23 Aug 2013 00:40:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEC39203C4 for ; Fri, 23 Aug 2013 00:40:07 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 032D0201D5 for ; Fri, 23 Aug 2013 00:40:07 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VCfQ0-0005vd-8Z; Fri, 23 Aug 2013 00:40:00 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VCfPy-00061Y-3v; Fri, 23 Aug 2013 00:39:58 +0000 Received: from mail-bk0-x22f.google.com ([2a00:1450:4008:c01::22f]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VCfPs-00061C-Qg for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2013 00:39:55 +0000 Received: by mail-bk0-f47.google.com with SMTP id mx12so956836bkb.34 for ; Thu, 22 Aug 2013 17:39:26 -0700 (PDT) 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=scV89rUoX7BO5ulXHHi4c4aHhxftdXKIRoAIy61Wock=; b=Px347tHhGzDqG9NA3+DxqjVn0nLxm5gvQrepdd+sUCME4Bc5G3PjCEwYrrox6xhoek g9KncylWsnvMMsGwE02o+2Xl+KiCqrhYVigw6rlIVEY1PME8I5v2GjBe6iW6tCqYWT9a mFwrl4JCTHhN/Tz/ZW8LCmm4OtxEjqanm1bcU3cu/WCVEspKhlAs1GrgfmZ5M99H7Qjm Q0QzR+8Z/7SdQF/8Id5Zgbkrwa0B4Y/NhTyk4JvorxrPCaCgSeMEcTpxT1215VhwVmpl VQD3CETK0Hfs6Gog2gSyNNdx+RJtFmCt/ayRuwLIJOEXYZRM1h+hdDnPiH5h1dlh68Nd NRvQ== MIME-Version: 1.0 X-Received: by 10.204.188.200 with SMTP id db8mr12286259bkb.12.1377218019905; Thu, 22 Aug 2013 17:33:39 -0700 (PDT) Received: by 10.205.13.74 with HTTP; Thu, 22 Aug 2013 17:33:39 -0700 (PDT) Date: Fri, 23 Aug 2013 08:33:39 +0800 Message-ID: Subject: [PATCH -next] spi: sirf: fix error return code in spi_sirfsoc_probe() From: Wei Yongjun To: baohua.song@csr.com, broonie@kernel.org, grant.likely@linaro.org, rob.herring@calxeda.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130822_203953_068761_356E726B X-CRM114-Status: GOOD ( 10.39 ) X-Spam-Score: -2.0 (--) Cc: devicetree@vger.kernel.org, yongjun_wei@trendmicro.com.cn, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/spi/spi-sirf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index 62c92c3..9b41254 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -655,12 +655,14 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) (void *)rx_dma_ch); if (!sspi->rx_chan) { dev_err(&pdev->dev, "can not allocate rx dma channel\n"); + ret = -ENODEV; goto free_master; } sspi->tx_chan = dma_request_channel(dma_cap_mask, (dma_filter_fn)sirfsoc_dma_filter_id, (void *)tx_dma_ch); if (!sspi->tx_chan) { dev_err(&pdev->dev, "can not allocate tx dma channel\n"); + ret = -ENODEV; goto free_rx_dma; } @@ -683,8 +685,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) writel(0, sspi->base + SIRFSOC_SPI_DUMMY_DELAY_CTL); sspi->dummypage = kmalloc(2 * PAGE_SIZE, GFP_KERNEL); - if (!sspi->dummypage) + if (!sspi->dummypage) { + ret = -ENOMEM; goto free_clk; + } ret = spi_bitbang_start(&sspi->bitbang); if (ret)