aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-08-04 07:05:25 -0400
committerArnd Bergmann <arnd@arndb.de>2012-08-10 06:27:46 -0400
commitd680e2c11eb0ddd21ba438b3a537e2eb093ff86f (patch)
tree46a94ebf41980f2cc3e25d2a4d8cf26a5a9b2f48 /drivers/mtd/nand
parent38eaed327dc5bea2e5548ea3d195de83a2070c6d (diff)
mtd/omap2: fix dmaengine_slave_config error handling
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 <arnd@arndb.de> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Grazvydas Ignotas <notasas@gmail.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/omap2.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index e9309b3659e7..ac4fd756eda3 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)
1245 goto out_release_mem_region; 1245 goto out_release_mem_region;
1246 } else { 1246 } else {
1247 struct dma_slave_config cfg; 1247 struct dma_slave_config cfg;
1248 int rc;
1249 1248
1250 memset(&cfg, 0, sizeof(cfg)); 1249 memset(&cfg, 0, sizeof(cfg));
1251 cfg.src_addr = info->phys_base; 1250 cfg.src_addr = info->phys_base;
@@ -1254,10 +1253,10 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
1254 cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 1253 cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1255 cfg.src_maxburst = 16; 1254 cfg.src_maxburst = 16;
1256 cfg.dst_maxburst = 16; 1255 cfg.dst_maxburst = 16;
1257 rc = dmaengine_slave_config(info->dma, &cfg); 1256 err = dmaengine_slave_config(info->dma, &cfg);
1258 if (rc) { 1257 if (err) {
1259 dev_err(&pdev->dev, "DMA engine slave config failed: %d\n", 1258 dev_err(&pdev->dev, "DMA engine slave config failed: %d\n",
1260 rc); 1259 err);
1261 goto out_release_mem_region; 1260 goto out_release_mem_region;
1262 } 1261 }
1263 info->nand.read_buf = omap_read_buf_dma_pref; 1262 info->nand.read_buf = omap_read_buf_dma_pref;