From: Fabio Estevam <festevam@gmail.com>
To: computersforpeace@gmail.com
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
linux-mtd@lists.infradead.org, shijie8@gmail.com,
han.xu@freescale.com
Subject: [PATCH 3/3] mtd: fsl-quadspi: Remove unnecessary 'map_failed' label
Date: Thu, 22 Jan 2015 22:43:07 -0200 [thread overview]
Message-ID: <1421973787-3240-3-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1421973787-3240-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
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>
---
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;
}
--
1.9.1
next prev parent reply other threads:[~2015-01-23 0:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 0:43 [PATCH 1/3] mtd: fsl-quadspi: Fix the error paths Fabio Estevam
2015-01-23 0:43 ` [PATCH 2/3] mtd: fsl-quadspi: Remove unneeded success/error messages Fabio Estevam
2015-01-23 19:36 ` Han Xu
2015-01-23 0:43 ` Fabio Estevam [this message]
2015-01-23 19:38 ` [PATCH 3/3] mtd: fsl-quadspi: Remove unnecessary 'map_failed' label Han Xu
2015-01-23 19:35 ` [PATCH 1/3] mtd: fsl-quadspi: Fix the error paths Han Xu
2015-02-06 4:04 ` Brian Norris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1421973787-3240-3-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=han.xu@freescale.com \
--cc=linux-mtd@lists.infradead.org \
--cc=shijie8@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox