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, b45815@freescale.com,
	linux-mtd@lists.infradead.org
Subject: [PATCH 2/2] mtd: fsl-quadspi: Provide an error code on spi_nor_match_id() failure
Date: Fri, 17 Oct 2014 15:31:09 -0300	[thread overview]
Message-ID: <1413570669-30738-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1413570669-30738-1-git-send-email-festevam@gmail.com>

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

If spi_nor_match_id fails then we need to propagate an error code into 'ret',
otherwise the probe function will succeed.

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

diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index c5d10c3..4a2799f 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -911,8 +911,10 @@ static int fsl_qspi_probe(struct platform_device *pdev)
 			goto map_failed;
 
 		id = spi_nor_match_id(modalias);
-		if (!id)
+		if (!id) {
+			ret = -EINVAL;
 			goto map_failed;
+		}
 
 		ret = of_property_read_u32(np, "spi-max-frequency",
 				&q->clk_rate);
-- 
1.9.1

  reply	other threads:[~2014-10-17 18:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 18:31 [PATCH 1/2] mtd: fsl-quadspi: Propagate the error from of_modalias_node() Fabio Estevam
2014-10-17 18:31 ` Fabio Estevam [this message]
2014-10-22  8:52   ` [PATCH 2/2] mtd: fsl-quadspi: Provide an error code on spi_nor_match_id() failure Brian Norris
2014-10-19  2:30 ` [PATCH 1/2] mtd: fsl-quadspi: Propagate the error from of_modalias_node() Huang Shijie
2014-10-22  8:50 ` 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=1413570669-30738-2-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=b32955@freescale.com \
    --cc=b45815@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