Commit 82ae61c4 authored by Sachin Kamat's avatar Sachin Kamat Committed by Lee Jones

mfd: wm8400-core: Remove unnecessary goto

Return directly to avoid redundant lines of code.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 730876be
...@@ -161,31 +161,19 @@ static int wm8400_i2c_probe(struct i2c_client *i2c, ...@@ -161,31 +161,19 @@ static int wm8400_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
struct wm8400 *wm8400; struct wm8400 *wm8400;
int ret;
wm8400 = devm_kzalloc(&i2c->dev, sizeof(struct wm8400), GFP_KERNEL); wm8400 = devm_kzalloc(&i2c->dev, sizeof(struct wm8400), GFP_KERNEL);
if (wm8400 == NULL) { if (!wm8400)
ret = -ENOMEM; return -ENOMEM;
goto err;
}
wm8400->regmap = devm_regmap_init_i2c(i2c, &wm8400_regmap_config); wm8400->regmap = devm_regmap_init_i2c(i2c, &wm8400_regmap_config);
if (IS_ERR(wm8400->regmap)) { if (IS_ERR(wm8400->regmap))
ret = PTR_ERR(wm8400->regmap); return PTR_ERR(wm8400->regmap);
goto err;
}
wm8400->dev = &i2c->dev; wm8400->dev = &i2c->dev;
i2c_set_clientdata(i2c, wm8400); i2c_set_clientdata(i2c, wm8400);
ret = wm8400_init(wm8400, dev_get_platdata(&i2c->dev)); return wm8400_init(wm8400, dev_get_platdata(&i2c->dev));
if (ret != 0)
goto err;
return 0;
err:
return ret;
} }
static int wm8400_i2c_remove(struct i2c_client *i2c) static int wm8400_i2c_remove(struct i2c_client *i2c)
......
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