regulator: act8865: Remove error variable in act8865_pmic_probe
authorAxel Lin <axel.lin@ingics.com>
Mon, 30 Jun 2014 07:32:09 +0000 (15:32 +0800)
committerMark Brown <broonie@linaro.org>
Tue, 5 Aug 2014 17:02:52 +0000 (18:02 +0100)
Simply use ret variable instead.
Also remove unneeded initialize for ret variable.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/act8865-regulator.c

index fe2c038f8cbc8cbcbffb3f3a28169ff4a51682ea..f07be3647985f5ac6e790ea844e9d4c58b6a9fec 100644 (file)
@@ -278,8 +278,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
        struct act8865 *act8865;
        struct device_node *of_node[ACT8865_REG_NUM];
        int i;
-       int ret = -EINVAL;
-       int error;
+       int ret;
 
        if (dev->of_node && !pdata) {
                const struct of_device_id *id;
@@ -307,10 +306,10 @@ static int act8865_pmic_probe(struct i2c_client *client,
 
        act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config);
        if (IS_ERR(act8865->regmap)) {
-               error = PTR_ERR(act8865->regmap);
+               ret = PTR_ERR(act8865->regmap);
                dev_err(&client->dev, "Failed to allocate register map: %d\n",
-                       error);
-               return error;
+                       ret);
+               return ret;
        }
 
        /* Finally register devices */