aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorMarkus Elfring2016-06-26 14:30:46 +0200
committerLee Jones2016-06-29 10:16:29 +0100
commit4dc03d0abb3a27cf5842a52c796fe4e3d9541985 (patch)
tree8612ceb579dd24e7a1d6cef40fc93928026129fc /drivers/mfd
parent53b34b8d8860833bc672b6deb77a1769b2f79b5b (diff)
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: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/smsc-ece1099.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mfd/smsc-ece1099.c b/drivers/mfd/smsc-ece1099.c
index 2aaf89fa66c3..cd18c09827ef 100644
--- a/drivers/mfd/smsc-ece1099.c
+++ b/drivers/mfd/smsc-ece1099.c
@@ -46,10 +46,8 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
}
smsc->regmap = devm_regmap_init_i2c(i2c, &smsc_regmap_config);
- if (IS_ERR(smsc->regmap)) {
- ret = PTR_ERR(smsc->regmap);
- goto err;
- }
+ if (IS_ERR(smsc->regmap))
+ return PTR_ERR(smsc->regmap);
i2c_set_clientdata(i2c, smsc);
smsc->dev = &i2c->dev;
@@ -68,7 +66,7 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
ret = regmap_write(smsc->regmap, SMSC_CLK_CTRL, smsc->clk);
if (ret)
- goto err;
+ return ret;
#ifdef CONFIG_OF
if (i2c->dev.of_node)
@@ -76,7 +74,6 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
NULL, NULL, &i2c->dev);
#endif
-err:
return ret;
}