From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Fabio Estevam <festevam@gmail.com>,
Fabio Estevam <fabio.estevam@nxp.com>
Cc: 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 14:31:12 +0200 [thread overview]
Message-ID: <20161024143112.66bb705a@bbrezillon> (raw)
In-Reply-To: <1477152922-6722-1-git-send-email-festevam@gmail.com>
On Sat, 22 Oct 2016 14:15:22 -0200
Fabio Estevam <festevam@gmail.com> 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>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Brian, can you take this patch in the MTD tree and queue it for the
next -rc?
> ---
> 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;
> }
>
next prev parent reply other threads:[~2016-10-24 12:31 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
2016-10-24 12:31 ` Boris Brezillon [this message]
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=20161024143112.66bb705a@bbrezillon \
--to=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 \
/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