All of lore.kernel.org
 help / color / mirror / Atom feed
From: Han Xu <xhnjupt@gmail.com>
To: Marek Vasut <marek.vasut@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>,
	boris.brezillon@free-electrons.com,
	Fabio Estevam <fabio.estevam@nxp.com>,
	han.xu@nxp.com, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: nand: gpmi: disable the clocks on errors
Date: Mon, 24 Oct 2016 22:49:29 +0800	[thread overview]
Message-ID: <20161024144929.GA31816@shlinux2> (raw)
In-Reply-To: <73e38ebd-3612-94c3-46bf-dc6e29925ee3@gmail.com>

On Sun, Oct 23, 2016 at 05:08:19AM +0200, Marek Vasut wrote:
> On 10/22/2016 06:15 PM, Fabio Estevam wrote:
> > From: Fabio Estevam <fabio.estevam@nxp.com>
> > 
> > We should disable the previously enabled GPMI clocks in the error paths.
> > 
> > Also, when gpmi_enable_clk() fails simply return the error
> > code immediately rather than jumping to to the 'err_out' label.
> > 
> > Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> 
> Reviewed-by: Marek Vasut <marex@denx.de>
> 

Acked-by: Han Xu<han.xu@nxp.com>

> > ---
> >  drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> > index 0f68a99..141bd70 100644
> > --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> > +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> > @@ -161,7 +161,7 @@ int gpmi_init(struct gpmi_nand_data *this)
> >  
> >  	ret = gpmi_enable_clk(this);
> >  	if (ret)
> > -		goto err_out;
> > +		return ret;
> >  	ret = gpmi_reset_block(r->gpmi_regs, false);
> >  	if (ret)
> >  		goto err_out;
> > @@ -197,6 +197,7 @@ int gpmi_init(struct gpmi_nand_data *this)
> >  	gpmi_disable_clk(this);
> >  	return 0;
> >  err_out:
> > +	gpmi_disable_clk(this);
> >  	return ret;
> >  }
> >  
> > @@ -270,7 +271,7 @@ int bch_set_geometry(struct gpmi_nand_data *this)
> >  
> >  	ret = gpmi_enable_clk(this);
> >  	if (ret)
> > -		goto err_out;
> > +		return ret;
> >  
> >  	/*
> >  	* Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this
> > @@ -308,6 +309,7 @@ int bch_set_geometry(struct gpmi_nand_data *this)
> >  	gpmi_disable_clk(this);
> >  	return 0;
> >  err_out:
> > +	gpmi_disable_clk(this);
> >  	return ret;
> >  }
> >  
> > 
> 
> 
> -- 
> Best regards,
> Marek Vasut
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2016-10-24 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-22 16:15 [PATCH] mtd: nand: gpmi: disable the clocks on errors Fabio Estevam
2016-10-23  3:08 ` Marek Vasut
2016-10-24 14:49   ` Han Xu [this message]
2016-10-24 12:31 ` Boris Brezillon
2016-10-24 13:14   ` Fabio Estevam

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=20161024144929.GA31816@shlinux2 \
    --to=xhnjupt@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=fabio.estevam@nxp.com \
    --cc=festevam@gmail.com \
    --cc=han.xu@nxp.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.