aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-01-22 19:43:07 -0500
committerBrian Norris <computersforpeace@gmail.com>2015-02-05 22:51:40 -0500
commitb1ab474fdaab6da2b9a0695b2c72ee5896dd6796 (patch)
treed35095b22e6ca343a0700387e208ea8a559e6d1a
parent50131b73de14894d556baa5510f4e49db0454d93 (diff)
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@freescale.com> Acked-by: Han Xu <han.xu@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--drivers/mtd/spi-nor/fsl-quadspi.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index 1c0572a0a576..b1cc182c46a1 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)
798 /* find the resources */ 798 /* find the resources */
799 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "QuadSPI"); 799 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "QuadSPI");
800 q->iobase = devm_ioremap_resource(dev, res); 800 q->iobase = devm_ioremap_resource(dev, res);
801 if (IS_ERR(q->iobase)) { 801 if (IS_ERR(q->iobase))
802 ret = PTR_ERR(q->iobase); 802 return PTR_ERR(q->iobase);
803 goto map_failed;
804 }
805 803
806 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 804 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
807 "QuadSPI-memory"); 805 "QuadSPI-memory");
808 q->ahb_base = devm_ioremap_resource(dev, res); 806 q->ahb_base = devm_ioremap_resource(dev, res);
809 if (IS_ERR(q->ahb_base)) { 807 if (IS_ERR(q->ahb_base))
810 ret = PTR_ERR(q->ahb_base); 808 return PTR_ERR(q->ahb_base);
811 goto map_failed; 809
812 }
813 q->memmap_phy = res->start; 810 q->memmap_phy = res->start;
814 811
815 /* find the clocks */ 812 /* find the clocks */
816 q->clk_en = devm_clk_get(dev, "qspi_en"); 813 q->clk_en = devm_clk_get(dev, "qspi_en");
817 if (IS_ERR(q->clk_en)) { 814 if (IS_ERR(q->clk_en))
818 ret = PTR_ERR(q->clk_en); 815 return PTR_ERR(q->clk_en);
819 goto map_failed;
820 }
821 816
822 q->clk = devm_clk_get(dev, "qspi"); 817 q->clk = devm_clk_get(dev, "qspi");
823 if (IS_ERR(q->clk)) { 818 if (IS_ERR(q->clk))
824 ret = PTR_ERR(q->clk); 819 return PTR_ERR(q->clk);
825 goto map_failed;
826 }
827 820
828 ret = clk_prepare_enable(q->clk_en); 821 ret = clk_prepare_enable(q->clk_en);
829 if (ret) { 822 if (ret) {
830 dev_err(dev, "can not enable the qspi_en clock\n"); 823 dev_err(dev, "can not enable the qspi_en clock\n");
831 goto map_failed; 824 return ret;
832 } 825 }
833 826
834 ret = clk_prepare_enable(q->clk); 827 ret = clk_prepare_enable(q->clk);
@@ -952,7 +945,6 @@ irq_failed:
952 clk_disable_unprepare(q->clk); 945 clk_disable_unprepare(q->clk);
953clk_failed: 946clk_failed:
954 clk_disable_unprepare(q->clk_en); 947 clk_disable_unprepare(q->clk_en);
955map_failed:
956 return ret; 948 return ret;
957} 949}
958 950