Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4833128imm; Tue, 16 Oct 2018 00:14:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV62oj99drSz4zx/4pq+JJO3StZhByKNoO7xShgZKxhzj7dMxTkwzXP7VetOyQw2gC1Vn8UnI X-Received: by 2002:aa7:850d:: with SMTP id v13-v6mr21250240pfn.83.1539674096732; Tue, 16 Oct 2018 00:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539674096; cv=none; d=google.com; s=arc-20160816; b=nL7+SjNK17uObOzdCHwzkUyfSsJH2htoY6RxuRYK3Hnel9jIXvB0L5d+1giBbPgeUW ESL75R2EomDx5z+M77S46ezAOI8L7IJ21Gl5FTcnmZIUmpC3kin1OO40a2CSJewByvTP +rwtk3+Yp+1GMxlquomcKq0O0nc3mztybLg1smtMJhZ/J1yEEVYumMMfwCkZgXUTsygl bKqk6OCC6fxjiHxhfGW9WyDTPF47KFE7K/X3xNzC4hXw1mtbOZCNT5U+dQTcTDhX4KW6 0tziu54k6tFpqXB81C/1AG9EGQOGVy9ycN70bCgyBSFa1/9gn/LQFYtbIrv4Oe8aIuQD jlqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=7jrn4OnibCBw0mFcazELArqHx3PdH81yQhKFyFoUmnE=; b=gLZsc07pcrvhfWGd5sS3zeEEMmWZ3ZOalZCCqmnoKuX5PpvIfQAx6mpjZbSXbJvG5B 5CiBQdSKJMz+0l/Vo0+gV0Y9bFr73sOPF78pGO8GxtzISy7cYyOFT8QXgJOPA9MN6R7o hTGkAlkpv0pMVa3hEQr1Xxntmfw5nK/wlNR3l322sIXx3Eb6sbIqIpDMfMtLWgeVAxnd wxKA17RlouPfsZjDyVKUAyDAKb++pWpWf+ZsMkwhDeUOSya9TKBvjDZnlakb07cmxRPW YGzMoMonG0l/pIQ6n7Mg/rw/iPOEpPqroCWU0W32wk1F4i1PfFOmT6ZoX5+JoowjBgNZ VWpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f25-v6si12851635pgb.170.2018.10.16.00.14.39; Tue, 16 Oct 2018 00:14:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727003AbeJPPDT (ORCPT + 99 others); Tue, 16 Oct 2018 11:03:19 -0400 Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:57605 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbeJPPDT (ORCPT ); Tue, 16 Oct 2018 11:03:19 -0400 Received: from ubuntu-CJ.clients.t21.sncf.fr ([109.190.253.15]) by mwinf5d36 with ME id o7Dt1y00t0Li4Kx037EBmy; Tue, 16 Oct 2018 09:14:16 +0200 X-ME-Helo: ubuntu-CJ.clients.t21.sncf.fr X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 16 Oct 2018 09:14:16 +0200 X-ME-IP: 109.190.253.15 From: Christophe JAILLET To: marek.vasut@gmail.com, dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@bootlin.com, richard@nod.at Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] mtd: spi-nor: cadence-quadspi: Fix the return value in case of error in 'cqspi_direct_read_execute()' Date: Tue, 16 Oct 2018 09:13:46 +0200 Message-Id: <20181016071346.25383-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We return 0 unconditionally in 'cqspi_direct_read_execute()'. However, 'ret' is set to some error codes in several error handling paths. Return 'ret' instead to propagate the error code. Fixes: ffa639e069fb ("mtd: spi-nor: cadence-quadspi: Add DMA support for direct mode reads") Signed-off-by: Christophe JAILLET --- drivers/mtd/spi-nor/cadence-quadspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c index 8e714fbfa521..6e9cbd1a0b6d 100644 --- a/drivers/mtd/spi-nor/cadence-quadspi.c +++ b/drivers/mtd/spi-nor/cadence-quadspi.c @@ -996,7 +996,7 @@ static int cqspi_direct_read_execute(struct spi_nor *nor, u_char *buf, err_unmap: dma_unmap_single(nor->dev, dma_dst, len, DMA_DEV_TO_MEM); - return 0; + return ret; } static ssize_t cqspi_read(struct spi_nor *nor, loff_t from, -- 2.17.1