Commit ecc8fa1c authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Samuel Ortiz

mfd: twl6040: Cleanup in early error handling in probe function

The err: label is not needed we can just return instead of the jump there.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 37aefe9f
...@@ -533,16 +533,12 @@ static int twl6040_probe(struct i2c_client *client, ...@@ -533,16 +533,12 @@ static int twl6040_probe(struct i2c_client *client,
twl6040 = devm_kzalloc(&client->dev, sizeof(struct twl6040), twl6040 = devm_kzalloc(&client->dev, sizeof(struct twl6040),
GFP_KERNEL); GFP_KERNEL);
if (!twl6040) { if (!twl6040)
ret = -ENOMEM; return -ENOMEM;
goto err;
}
twl6040->regmap = devm_regmap_init_i2c(client, &twl6040_regmap_config); twl6040->regmap = devm_regmap_init_i2c(client, &twl6040_regmap_config);
if (IS_ERR(twl6040->regmap)) { if (IS_ERR(twl6040->regmap))
ret = PTR_ERR(twl6040->regmap); return PTR_ERR(twl6040->regmap);
goto err;
}
i2c_set_clientdata(client, twl6040); i2c_set_clientdata(client, twl6040);
...@@ -660,7 +656,7 @@ static int twl6040_probe(struct i2c_client *client, ...@@ -660,7 +656,7 @@ static int twl6040_probe(struct i2c_client *client,
regulator_bulk_disable(TWL6040_NUM_SUPPLIES, twl6040->supplies); regulator_bulk_disable(TWL6040_NUM_SUPPLIES, twl6040->supplies);
regulator_get_err: regulator_get_err:
i2c_set_clientdata(client, NULL); i2c_set_clientdata(client, NULL);
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