mtd: fsl-quadspi: Remove unnecessary 'map_failed' label
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon Feb 16 18:59:05 PST 2015
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b1ab474fdaab6da2b9a0695b2c72ee5896dd6796
Commit: b1ab474fdaab6da2b9a0695b2c72ee5896dd6796
Parent: 50131b73de14894d556baa5510f4e49db0454d93
Author: Fabio Estevam <fabio.estevam at freescale.com>
AuthorDate: Thu Jan 22 22:43:07 2015 -0200
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Feb 5 19:51:40 2015 -0800
mtd: fsl-quadspi: Remove unnecessary 'map_failed' label
There is no need to keep the 'map_failed' label. We can simply return the error
code directly and let the code shorter and cleaner.
Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
Acked-by: Han Xu <han.xu at freescale.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/spi-nor/fsl-quadspi.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index 1c0572a..b1cc182 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -798,37 +798,30 @@ static int fsl_qspi_probe(struct platform_device *pdev)
/* find the resources */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "QuadSPI");
q->iobase = devm_ioremap_resource(dev, res);
- if (IS_ERR(q->iobase)) {
- ret = PTR_ERR(q->iobase);
- goto map_failed;
- }
+ if (IS_ERR(q->iobase))
+ return PTR_ERR(q->iobase);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"QuadSPI-memory");
q->ahb_base = devm_ioremap_resource(dev, res);
- if (IS_ERR(q->ahb_base)) {
- ret = PTR_ERR(q->ahb_base);
- goto map_failed;
- }
+ if (IS_ERR(q->ahb_base))
+ return PTR_ERR(q->ahb_base);
+
q->memmap_phy = res->start;
/* find the clocks */
q->clk_en = devm_clk_get(dev, "qspi_en");
- if (IS_ERR(q->clk_en)) {
- ret = PTR_ERR(q->clk_en);
- goto map_failed;
- }
+ if (IS_ERR(q->clk_en))
+ return PTR_ERR(q->clk_en);
q->clk = devm_clk_get(dev, "qspi");
- if (IS_ERR(q->clk)) {
- ret = PTR_ERR(q->clk);
- goto map_failed;
- }
+ if (IS_ERR(q->clk))
+ return PTR_ERR(q->clk);
ret = clk_prepare_enable(q->clk_en);
if (ret) {
dev_err(dev, "can not enable the qspi_en clock\n");
- goto map_failed;
+ return ret;
}
ret = clk_prepare_enable(q->clk);
@@ -952,7 +945,6 @@ irq_failed:
clk_disable_unprepare(q->clk);
clk_failed:
clk_disable_unprepare(q->clk_en);
-map_failed:
return ret;
}
More information about the linux-mtd-cvs
mailing list