public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Huang Shijie <shijie8@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
	b32955@freescale.com, computersforpeace@gmail.com,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer
Date: Sun, 19 Oct 2014 10:31:19 +0800	[thread overview]
Message-ID: <20141019023117.GC1412@localhost.localdomain> (raw)
In-Reply-To: <1413576841-5707-1-git-send-email-festevam@gmail.com>

On Fri, Oct 17, 2014 at 05:14:01PM -0300, Fabio Estevam wrote:
> 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
Acked-by: Huang Shijie <shijie8@gmail.com>

  reply	other threads:[~2014-10-19  2:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 20:14 [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer Fabio Estevam
2014-10-19  2:31 ` Huang Shijie [this message]
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=20141019023117.GC1412@localhost.localdomain \
    --to=shijie8@gmail.com \
    --cc=b32955@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=fabio.estevam@freescale.com \
    --cc=festevam@gmail.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