Skip to contentSkip to conversation

i2c: npcm7xx: Fix a couple error codes in probe

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 8, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: npcm7xx: Fix a couple error codes in probe

The code here is accidentally returning IS_ERR() which is 1 but it should be returning negative error codes with PTR_ERR().

Fixes 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")
---
 drivers/i2c/busses/i2c-npcm7xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-npcm7xx.c +2 -2
index a8e75c3484f12..d679a04be0fd0 100644
@@ -2239,12 +2239,12 @@ static int npcm_i2c_probe_bus(struct platform_device *pdev)
 
 	gcr_regmap = syscon_regmap_lookup_by_compatible("nuvoton,npcm750-gcr");
 	if (IS_ERR(gcr_regmap))
-		return IS_ERR(gcr_regmap);
+		return PTR_ERR(gcr_regmap);
 	regmap_write(gcr_regmap, NPCM_I2CSEGCTL, NPCM_I2CSEGCTL_INIT_VAL);
 
 	clk_regmap = syscon_regmap_lookup_by_compatible("nuvoton,npcm750-clk");
 	if (IS_ERR(clk_regmap))
-		return IS_ERR(clk_regmap);
+		return PTR_ERR(clk_regmap);
 
 	bus->reg = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(bus->reg))
Signature · 1 line
2.26.2
Applied
#1 lore raw
Quoted 5 lines · Dan Carpenter

The code here is accidentally returning IS_ERR() which is 1 but it should be returning negative error codes with PTR_ERR().

Fixes 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")

Applied to for-5.8, thanks!