Skip to contentSkip to conversation

i2c: Fix return value of bcm_kona_i2c_probe()

PATCH Applied zhaoxiao 3 participants 3 messages Sep 6, 2021 – Sep 29, 2021

Subsystems (2)
lore
Share & tools
lore

zhaoxiao

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/i2c/busses/i2c-bcm-kona.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-bcm-kona.c +1 -1
index ed5e1275ae46..8e350f20cde0 100644
@@ -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);
Signature · 1 line
2.20.1