From patchwork Thu Feb 27 12:37:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 183938 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4462872ile; Thu, 27 Feb 2020 04:39:48 -0800 (PST) X-Google-Smtp-Source: APXvYqygKRdhugXXbcFk72L0JqhFNuszuPlCZEUFfp19sBOLrWHZhjmJOCGtuWjd00GyTOCLfkgn X-Received: by 2002:a17:902:b206:: with SMTP id t6mr4475781plr.211.1582807188289; Thu, 27 Feb 2020 04:39:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582807188; cv=none; d=google.com; s=arc-20160816; b=nX5zwUfuiIv3LVspGYUMNBM5DUz1GvHT35o/kVgr6VGB5OB9ApFABjGKgbriVIzDG+ THeXdWHDKrhxgwcX9bzRYSq6Qvk14qtYz2BOCaFCGsBXOy7jBO0cxTaVk6i/bmv33lqX dQ9keQ6qSj0anHGNKCNzJ7zxGEcbTclaygfEo2h4jMcxxVp4TMY0PERe4aejCfVUhVf7 j8vs2n0sxzZLWMoswewyIx3VpzbfkEAuTCgvZzZczKEth++YOSPmgkWhmqyAolmdZqKR oQCNNHssDnbT4eWMcX07H0muYZYyKU2xLNmQFuQ4Dl6CZ8KOnfOaRi98KO3ss40+PxTH 2idQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=pp5tdFc6VScqDm/JHlEYK3y5C9zQYBCjicIVLmIxUYo=; b=TUU1bGMadzBlKNCWroHVq7O5cJBo0lABkjd87z8242RsP8u9Mc2SKTRqJKoxgUBkxy yi9S42HQnW06Gr2XAXij13pba+zVMK6S0XaZlPn2Hyz7j8hFk4OAfxOcEcslvLhSjn8y Ahz9c5K/0q6mvZUOxND+ISZD+55hwYIkY59cP7cxo4szaVwGQdoPGtrG1YApdDZpMgxl AJC2Mu39riWL8aL9XYXlgOVjMD1r6InK0hD36b0umZ8HKPiCVZw9CaX0MXpe2ffXYaUw n2kcP7xSppfDhn3CAng7FZ2ONmVcoFZvB9lqYlGG0rhWgQ6VyV5AZZuYYVU3C9HaU2/7 S0WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=WGOWLuqH; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=J5g8ORUa; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id 190si3140377pga.16.2020.02.27.04.39.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 04:39:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=WGOWLuqH; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=J5g8ORUa; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pp5tdFc6VScqDm/JHlEYK3y5C9zQYBCjicIVLmIxUYo=; b=WGOWLuqHbECEQ0 V4GOGj7u7VrY316VDuDVj6XFw65jP6zRqjloCcYhaKrjjzysqjzLins7xHjHqX6o57dCK2+HxokWh AC5xs94gOB7k4QJ05L10KXNwM7gD8q2TVo8v0eaPyCB9sGnBfrJgfGDf+brKgHBOrf90h66J1wAab Ls+XkSTTdHZgLClPMSEk0b4aDqZ4FZmtJmW/jnHCAgCOcZiB5NjaM9i7VFOCJmJJlc0WPIvVDxOII 5shk2dBNBU3sMiuu81Z7dN7pJYTEVnxly60qkyX+N3rK+qJ2xWacd1qOjMumvrSDXYvTmjO1BlO4/ F8Bb8yWK9uwUu5oEtEWw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7IS0-00030a-O2; Thu, 27 Feb 2020 12:39:36 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7IQZ-0001hb-Pk; Thu, 27 Feb 2020 12:38:11 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 01RCbuKr117335; Thu, 27 Feb 2020 06:37:56 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1582807076; bh=Z4xHzVimku6GaO/uJJfGUrX05MI6KgVNH9lyK1vuJOw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=J5g8ORUa0Uh8C9gatDxzoG78qgUFARSC6gCL1Io+L+FE/JwuvC+qu0faZo8uDTmky ddw6DK5xpdJAtZNyuy4j43amj94PldkNgAsUylQ6LRABCmC2JlAOIcAZz8rXLoTcJt G4LozC50Gcxz5fYfGFNcVCPLEfNUqYQfEU4j0ras= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 01RCbus6127675 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 27 Feb 2020 06:37:56 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 27 Feb 2020 06:37:55 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 27 Feb 2020 06:37:55 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 01RCbnvO100207; Thu, 27 Feb 2020 06:37:52 -0600 From: Peter Ujfalusi To: , , , , , , , Subject: [PATCH 1/7] mtd: rawnand: gpmi: Use dma_request_chan() instead dma_request_slave_channel() Date: Thu, 27 Feb 2020 14:37:43 +0200 Message-ID: <20200227123749.24064-2-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227123749.24064-1-peter.ujfalusi@ti.com> References: <20200227123749.24064-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200227_043807_961447_AE272FC5 X-CRM114-Status: GOOD ( 14.29 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [198.47.19.141 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: vkoul@kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org dma_request_slave_channel() is a wrapper on top of dma_request_chan() eating up the error code. Use using dma_request_chan() directly to return the real error code. Signed-off-by: Peter Ujfalusi --- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c index b9d5d55a5edb..53b00c841aec 100644 --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c @@ -1148,20 +1148,21 @@ static int acquire_dma_channels(struct gpmi_nand_data *this) { struct platform_device *pdev = this->pdev; struct dma_chan *dma_chan; + int ret = 0; /* request dma channel */ - dma_chan = dma_request_slave_channel(&pdev->dev, "rx-tx"); - if (!dma_chan) { - dev_err(this->dev, "Failed to request DMA channel.\n"); - goto acquire_err; + dma_chan = dma_request_chan(&pdev->dev, "rx-tx"); + if (IS_ERR(dma_chan)) { + ret = PTR_ERR(dma_chan); + if (ret != -EPROBE_DEFER) + dev_err(this->dev, "DMA channel request failed: %d\n", + ret); + release_dma_channels(this); + } else { + this->dma_chans[0] = dma_chan; } - this->dma_chans[0] = dma_chan; - return 0; - -acquire_err: - release_dma_channels(this); - return -EINVAL; + return ret; } static int gpmi_get_clks(struct gpmi_nand_data *this)