i2c: npcm7xx: Fix a couple of 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: 56a1485b10 ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
Dan Carpenter 2020-06-08 17:17:27 +03:00 committed by Wolfram Sang
parent cdb555397f
commit de9be772c6
1 changed files with 2 additions and 2 deletions

View File

@ -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))