LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: zhaoxiao <long870912@gmail.com>
To: f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com,
	bcm-kernel-feedback-list@broadcom.com
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhaoxiao <long870912@gmail.com>
Subject: [PATCH] i2c: Fix return value of bcm_kona_i2c_probe()
Date: Mon,  6 Sep 2021 13:27:30 +0800	[thread overview]
Message-ID: <20210906052730.19644-1-long870912@gmail.com> (raw)

When call function devm_platform_ioremap_resource(), we should use IS_ERR()
to check the return value and return PTR_ERR() if failed.

Signed-off-by: zhaoxiao <long870912@gmail.com>
---
 drivers/i2c/busses/i2c-bcm-kona.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-bcm-kona.c b/drivers/i2c/busses/i2c-bcm-kona.c
index ed5e1275ae46..8e350f20cde0 100644
--- a/drivers/i2c/busses/i2c-bcm-kona.c
+++ b/drivers/i2c/busses/i2c-bcm-kona.c
@@ -763,7 +763,7 @@ static int bcm_kona_i2c_probe(struct platform_device *pdev)
 	/* Map hardware registers */
 	dev->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(dev->base))
-		return -ENOMEM;
+		return PTR_ERR(dev->base);
 
 	/* Get and enable external clock */
 	dev->external_clk = devm_clk_get(dev->device, NULL);
-- 
2.20.1


             reply	other threads:[~2021-09-06  5:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06  5:27 zhaoxiao [this message]
2021-09-16  0:07 ` Florian Fainelli
2021-09-29 21:05 ` Wolfram Sang
     [not found] <20210816083756.22294-1-zhaoxiao@uniontech.com>
2021-08-22  9:07 ` Florian Fainelli

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=20210906052730.19644-1-long870912@gmail.com \
    --to=long870912@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --subject='Re: [PATCH] i2c: Fix return value of bcm_kona_i2c_probe()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).