From patchwork Wed Aug 8 14:47:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10595 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B74C123F00 for ; Wed, 8 Aug 2012 14:47:49 +0000 (UTC) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by fiordland.canonical.com (Postfix) with ESMTP id B00BDA190B1 for ; Wed, 8 Aug 2012 14:47:49 +0000 (UTC) Received: by wibhq12 with SMTP id hq12so623638wib.17 for ; Wed, 08 Aug 2012 07:47:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=9BzoQsAHpdMgD/GZdSqEw45dYp0vp5VTcl5ki0EsQUo=; b=W5b/BkQ45JJd2QLC5T5iUMxMj1QcErjko/1z3dvPzP8cTvKQAqxkorf5R4NBFnbbfJ MaIxLzd49u5nAClm8zi92mN3+quT6USiUWhUcmFVufhAJzNzrP8AMsaAJTAaf6nZYHtg nrQ2QD/FTwoD5IQm/PcvYIg7JAzG0L58G4rtCVwB3ggcQFh7uRCAq0M9h8cWmtsheoOi 5KupAfLYzchQPoFD9z7Mc9Pt9gGzOzCOkPReuOYQcNYxK6W+6MvXykkpYTLfhqE9ZuY1 DsRLLAqQgc66Z4hXtMOu2a9ivRiBKwXonpLDI/gxmKEDapyuK0z585I/bRxGWQ4j1Gbu b6aA== Received: by 10.50.186.131 with SMTP id fk3mr1236318igc.31.1344437268236; Wed, 08 Aug 2012 07:47:48 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp611883igc; Wed, 8 Aug 2012 07:47:47 -0700 (PDT) Received: by 10.204.155.146 with SMTP id s18mr7615981bkw.23.1344437266839; Wed, 08 Aug 2012 07:47:46 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.126.186]) by mx.google.com with ESMTP id hu14si23807706bkc.104.2012.08.08.07.47.46; Wed, 08 Aug 2012 07:47:46 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.186 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.186; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.126.186 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from klappe2.boeblingen.de.ibm.com (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MTMxT-1T8dp91DkN-00RugF; Wed, 08 Aug 2012 16:47:36 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: arm@kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Russell King , Grazvydas Ignotas Subject: [PATCH 08/11] mtd/omap2: fix dmaengine_slave_config error handling Date: Wed, 8 Aug 2012 16:47:25 +0200 Message-Id: <1344437248-20560-9-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1344437248-20560-1-git-send-email-arnd@arndb.de> References: <1344437248-20560-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:ukBNsWwSy8Q7NQEPAFxUFPJHzryJBbW1VK4UD6SD+kg oJmymv7x+NT4SnEnQtCYa8L7JI/pyC6Fk91qdPqRozFEsP0+q2 PasC48B5jq+8pHcfQHyNNlP04QuRVLKrh1+yRtJaK4PEtn8kGP 9yRsXQ7tYyWjNDQ5+fa00EoIme0eLMVibeereFg1NPDb+eWQdH avamXZoli009M55fUS9CxJ3WGx/c3erI9aVJlKVnMBVXoGIzRB kLXQAiwU458OUFfWZA5z4teap6tvYySioQvmtKpEQ2pjE1Td/J 9Q+sKBWV9eY1menErD2Kzh7KVP2epUzTQfw06d8MfmZ3H7at9m 281E/kXu2xWSSv2P+cbOuxDgxCfpuCU94k9PlEwvj7DTxNjaI7 XrL7gGbZH8+/QhLqjNHt8WhQ/gJOePbBKY= X-Gm-Message-State: ALoCoQk9N1mQhi56Bw0FAS7eb7/IeulgkV1hDeOwyQvkZJsAO7yLzgEEPTZTytH9v2Eq8tIemke9 The newly added dmaengine support in the omap2 nand driver potentially causes an undefined return value from the omap_nand_probe function when dmaengine_slave_config reports an error. Let's handle this by returning the same error back to the caller. Without this patch, building omap2plus_defconfig results in: drivers/mtd/nand/omap2.c: In function 'omap_nand_probe': drivers/mtd/nand/omap2.c:1154:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Arnd Bergmann Cc: Russell King Cc: Grazvydas Ignotas --- drivers/mtd/nand/omap2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index e9309b3..ac4fd75 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1245,7 +1245,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) goto out_release_mem_region; } else { struct dma_slave_config cfg; - int rc; memset(&cfg, 0, sizeof(cfg)); cfg.src_addr = info->phys_base; @@ -1254,10 +1253,10 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; cfg.src_maxburst = 16; cfg.dst_maxburst = 16; - rc = dmaengine_slave_config(info->dma, &cfg); - if (rc) { + err = dmaengine_slave_config(info->dma, &cfg); + if (err) { dev_err(&pdev->dev, "DMA engine slave config failed: %d\n", - rc); + err); goto out_release_mem_region; } info->nand.read_buf = omap_read_buf_dma_pref;