All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Yogesh Gaur <yogeshgaur.83@gmail.com>, Han Xu <han.xu@nxp.com>,
	Adam Ford <aford173@gmail.com>
Cc: Ashish Kumar <ashish.kumar@nxp.com>,
	Mark Brown <broonie@kernel.org>,
	linux-spi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] spi: spi-nxp-fspi: Fix a NULL vs IS_ERR() check in probe
Date: Thu, 12 Mar 2020 11:31:54 +0000	[thread overview]
Message-ID: <20200312113154.GC20562@mwanda> (raw)

The platform_get_resource_byname() function returns NULL on error, it
doesn't return error pointers.

Fixes: d166a73503ef ("spi: fspi: dynamically alloc AHB memory")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
The commit message for commit d166a73503ef ("spi: fspi: dynamically
alloc AHB memory") is not very good.  Why is it necessary to allocate
the AHB memory dynamically instead of during probe?  Also I suspect that
Adam should have recieved authorship credit for that patch.

 drivers/spi/spi-nxp-fspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index 019f40e2917c..1ccda82da206 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -1019,8 +1019,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 
 	/* find the resources - controller memory mapped space */
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap");
-	if (IS_ERR(res)) {
-		ret = PTR_ERR(res);
+	if (!res) {
+		ret = -ENODEV;
 		goto err_put_ctrl;
 	}
 
-- 
2.20.1

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Yogesh Gaur <yogeshgaur.83@gmail.com>, Han Xu <han.xu@nxp.com>,
	Adam Ford <aford173@gmail.com>
Cc: Ashish Kumar <ashish.kumar@nxp.com>,
	Mark Brown <broonie@kernel.org>,
	linux-spi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] spi: spi-nxp-fspi: Fix a NULL vs IS_ERR() check in probe
Date: Thu, 12 Mar 2020 14:31:54 +0300	[thread overview]
Message-ID: <20200312113154.GC20562@mwanda> (raw)

The platform_get_resource_byname() function returns NULL on error, it
doesn't return error pointers.

Fixes: d166a73503ef ("spi: fspi: dynamically alloc AHB memory")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
The commit message for commit d166a73503ef ("spi: fspi: dynamically
alloc AHB memory") is not very good.  Why is it necessary to allocate
the AHB memory dynamically instead of during probe?  Also I suspect that
Adam should have recieved authorship credit for that patch.

 drivers/spi/spi-nxp-fspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index 019f40e2917c..1ccda82da206 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -1019,8 +1019,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 
 	/* find the resources - controller memory mapped space */
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap");
-	if (IS_ERR(res)) {
-		ret = PTR_ERR(res);
+	if (!res) {
+		ret = -ENODEV;
 		goto err_put_ctrl;
 	}
 
-- 
2.20.1

             reply	other threads:[~2020-03-12 11:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 11:31 Dan Carpenter [this message]
2020-03-12 11:31 ` [PATCH] spi: spi-nxp-fspi: Fix a NULL vs IS_ERR() check in probe Dan Carpenter
2020-03-12 11:58 ` Adam Ford
2020-03-12 11:58   ` Adam Ford
     [not found]   ` <CAHCN7xKSc7spZyq=mySWHDmSrGMkQo8FYRbn-NzYRa7iB-0BoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-03-12 17:47     ` Dan Carpenter
2020-03-12 17:47       ` Dan Carpenter
2020-03-12 12:11 ` Fabio Estevam
2020-03-12 12:11   ` Fabio Estevam
2020-03-12 12:18   ` Mark Brown
     [not found]     ` <VI1PR04MB4015D509DC78B0C7EA649CC995FA0@VI1PR04MB4015.eurprd04.prod.outlook.com>
2020-03-13 11:54       ` [EXT] " Mark Brown
2020-03-12 16:52 ` Applied "spi: spi-nxp-fspi: Fix a NULL vs IS_ERR() check in probe" to the spi tree Mark Brown
2020-03-12 16:52   ` Mark Brown

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=20200312113154.GC20562@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=aford173@gmail.com \
    --cc=ashish.kumar@nxp.com \
    --cc=broonie@kernel.org \
    --cc=han.xu@nxp.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=yogeshgaur.83@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.