mfd: wm8400-core: Remove unnecessary goto
authorSachin Kamat <sachin.kamat@linaro.org>
Fri, 14 Feb 2014 09:51:05 +0000 (15:21 +0530)
committerLee Jones <lee.jones@linaro.org>
Wed, 19 Mar 2014 08:58:19 +0000 (08:58 +0000)
Return directly to avoid redundant lines of code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/wm8400-core.c

index d66d256551fb77768fc9d458d5493c976ec25f30..e5eae751aa1b1f22e6747fd94bc85ba62174f8d8 100644 (file)
@@ -161,31 +161,19 @@ static int wm8400_i2c_probe(struct i2c_client *i2c,
                            const struct i2c_device_id *id)
 {
        struct wm8400 *wm8400;
-       int ret;
 
        wm8400 = devm_kzalloc(&i2c->dev, sizeof(struct wm8400), GFP_KERNEL);
-       if (wm8400 == NULL) {
-               ret = -ENOMEM;
-               goto err;
-       }
+       if (!wm8400)
+               return -ENOMEM;
 
        wm8400->regmap = devm_regmap_init_i2c(i2c, &wm8400_regmap_config);
-       if (IS_ERR(wm8400->regmap)) {
-               ret = PTR_ERR(wm8400->regmap);
-               goto err;
-       }
+       if (IS_ERR(wm8400->regmap))
+               return PTR_ERR(wm8400->regmap);
 
        wm8400->dev = &i2c->dev;
        i2c_set_clientdata(i2c, wm8400);
 
-       ret = wm8400_init(wm8400, dev_get_platdata(&i2c->dev));
-       if (ret != 0)
-               goto err;
-
-       return 0;
-
-err:
-       return ret;
+       return wm8400_init(wm8400, dev_get_platdata(&i2c->dev));
 }
 
 static int wm8400_i2c_remove(struct i2c_client *i2c)