[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210906052730.19644-1-long870912@gmail.com>
Date: Mon, 6 Sep 2021 13:27:30 +0800
From: zhaoxiao <long870912@...il.com>
To: f.fainelli@...il.com, rjui@...adcom.com, sbranden@...adcom.com,
bcm-kernel-feedback-list@...adcom.com
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
zhaoxiao <long870912@...il.com>
Subject: [PATCH] i2c: Fix return value of bcm_kona_i2c_probe()
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@...il.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
Powered by blists - more mailing lists