Commit 4dc03d0a authored by Markus Elfring's avatar Markus Elfring Committed by Lee Jones

mfd: smsc-ece1099: Return directly after a function failure in smsc_i2c_probe()

This issue was detected by using the Coccinelle software.

Return directly if a call of the function "devm_regmap_init_i2c"
or "regmap_write" failed.

Delete the jump label "err" then.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 53b34b8d
...@@ -46,10 +46,8 @@ static int smsc_i2c_probe(struct i2c_client *i2c, ...@@ -46,10 +46,8 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
} }
smsc->regmap = devm_regmap_init_i2c(i2c, &smsc_regmap_config); smsc->regmap = devm_regmap_init_i2c(i2c, &smsc_regmap_config);
if (IS_ERR(smsc->regmap)) { if (IS_ERR(smsc->regmap))
ret = PTR_ERR(smsc->regmap); return PTR_ERR(smsc->regmap);
goto err;
}
i2c_set_clientdata(i2c, smsc); i2c_set_clientdata(i2c, smsc);
smsc->dev = &i2c->dev; smsc->dev = &i2c->dev;
...@@ -68,7 +66,7 @@ static int smsc_i2c_probe(struct i2c_client *i2c, ...@@ -68,7 +66,7 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
ret = regmap_write(smsc->regmap, SMSC_CLK_CTRL, smsc->clk); ret = regmap_write(smsc->regmap, SMSC_CLK_CTRL, smsc->clk);
if (ret) if (ret)
goto err; return ret;
#ifdef CONFIG_OF #ifdef CONFIG_OF
if (i2c->dev.of_node) if (i2c->dev.of_node)
...@@ -76,7 +74,6 @@ static int smsc_i2c_probe(struct i2c_client *i2c, ...@@ -76,7 +74,6 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
NULL, NULL, &i2c->dev); NULL, NULL, &i2c->dev);
#endif #endif
err:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment