From: Brian Norris <computersforpeace@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
linux-mtd@lists.infradead.org, shijie8@gmail.com,
han.xu@freescale.com
Subject: Re: [PATCH 1/3] mtd: fsl-quadspi: Fix the error paths
Date: Thu, 5 Feb 2015 20:04:21 -0800 [thread overview]
Message-ID: <20150206040421.GD18140@ld-irv-0074> (raw)
In-Reply-To: <1421973787-3240-1-git-send-email-festevam@gmail.com>
On Thu, Jan 22, 2015 at 10:43:05PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Jumping to 'map_failed' label is not correct at these points, as it misses to
> disable the clocks that were previously enabled.
>
> Jump to 'irq_failed' label instead that will correctly disable the clocks.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Applied all 3 to l2-mtd.git, thanks.
> ---
> drivers/mtd/spi-nor/fsl-quadspi.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
> index a46bea3..a733bd2 100644
> --- a/drivers/mtd/spi-nor/fsl-quadspi.c
> +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
> @@ -890,24 +890,24 @@ static int fsl_qspi_probe(struct platform_device *pdev)
>
> ret = of_modalias_node(np, modalias, sizeof(modalias));
> if (ret < 0)
> - goto map_failed;
> + goto irq_failed;
>
> ret = of_property_read_u32(np, "spi-max-frequency",
> &q->clk_rate);
> if (ret < 0)
> - goto map_failed;
> + goto irq_failed;
>
> /* set the chip address for READID */
> fsl_qspi_set_base_addr(q, nor);
>
> ret = spi_nor_scan(nor, modalias, SPI_NOR_QUAD);
> if (ret)
> - goto map_failed;
> + goto irq_failed;
>
> ppdata.of_node = np;
> ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
> if (ret)
> - goto map_failed;
> + goto irq_failed;
>
> /* Set the correct NOR size now. */
> if (q->nor_size == 0) {
FYI, the error handling is still wrong here (it's just less wrong). If
the second device fails to scan for some reason, you aren't
unregistering the first. This will leave an MTD around that has no
driver backing it.
Brian
prev parent reply other threads:[~2015-02-06 4:04 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 ` [PATCH 3/3] mtd: fsl-quadspi: Remove unnecessary 'map_failed' label Fabio Estevam
2015-01-23 19:38 ` 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 [this message]
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=20150206040421.GD18140@ld-irv-0074 \
--to=computersforpeace@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.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