public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: computersforpeace@gmail.com
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
	b32955@freescale.com, linux-mtd@lists.infradead.org
Subject: [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer
Date: Fri, 17 Oct 2014 17:14:01 -0300	[thread overview]
Message-ID: <1413576841-5707-1-git-send-email-festevam@gmail.com> (raw)

From: Fabio Estevam <fabio.estevam@freescale.com>

When clk_prepare_enable(q->clk) fails it is clearer to disable the previous
acquired clock (q->clk_en) in the error path rather than doing it locally.

So disable q->clk_en in the error path only.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mtd/spi-nor/fsl-quadspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index e1c517d..8006f26 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -843,9 +843,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
 
 	ret = clk_prepare_enable(q->clk);
 	if (ret) {
-		clk_disable_unprepare(q->clk_en);
 		dev_err(dev, "can not enable the qspi clock\n");
-		goto map_failed;
+		goto clk_failed;
 	}
 
 	/* find the irq */
@@ -966,6 +965,7 @@ last_init_failed:
 
 irq_failed:
 	clk_disable_unprepare(q->clk);
+clk_failed:
 	clk_disable_unprepare(q->clk_en);
 map_failed:
 	dev_err(dev, "Freescale QuadSPI probe failed\n");
-- 
1.9.1

             reply	other threads:[~2014-10-17 20:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 20:14 Fabio Estevam [this message]
2014-10-19  2:31 ` [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer Huang Shijie
2014-10-22  8:54 ` 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=1413576841-5707-1-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=b32955@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=fabio.estevam@freescale.com \
    --cc=linux-mtd@lists.infradead.org \
    /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