Commit 97466d0d authored by Sachin Kamat's avatar Sachin Kamat Committed by Mauro Carvalho Chehab

[media] s5k6aa: Use devm_regulator_bulk_get API

devm_regulator_bulk_get is device managed and saves some cleanup
and exit code.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 23575bf4
...@@ -1598,7 +1598,7 @@ static int s5k6aa_probe(struct i2c_client *client, ...@@ -1598,7 +1598,7 @@ static int s5k6aa_probe(struct i2c_client *client,
for (i = 0; i < S5K6AA_NUM_SUPPLIES; i++) for (i = 0; i < S5K6AA_NUM_SUPPLIES; i++)
s5k6aa->supplies[i].supply = s5k6aa_supply_names[i]; s5k6aa->supplies[i].supply = s5k6aa_supply_names[i];
ret = regulator_bulk_get(&client->dev, S5K6AA_NUM_SUPPLIES, ret = devm_regulator_bulk_get(&client->dev, S5K6AA_NUM_SUPPLIES,
s5k6aa->supplies); s5k6aa->supplies);
if (ret) { if (ret) {
dev_err(&client->dev, "Failed to get regulators\n"); dev_err(&client->dev, "Failed to get regulators\n");
...@@ -1607,7 +1607,7 @@ static int s5k6aa_probe(struct i2c_client *client, ...@@ -1607,7 +1607,7 @@ static int s5k6aa_probe(struct i2c_client *client,
ret = s5k6aa_initialize_ctrls(s5k6aa); ret = s5k6aa_initialize_ctrls(s5k6aa);
if (ret) if (ret)
goto out_err4; goto out_err3;
s5k6aa_presets_data_init(s5k6aa); s5k6aa_presets_data_init(s5k6aa);
...@@ -1618,8 +1618,6 @@ static int s5k6aa_probe(struct i2c_client *client, ...@@ -1618,8 +1618,6 @@ static int s5k6aa_probe(struct i2c_client *client,
return 0; return 0;
out_err4:
regulator_bulk_free(S5K6AA_NUM_SUPPLIES, s5k6aa->supplies);
out_err3: out_err3:
s5k6aa_free_gpios(s5k6aa); s5k6aa_free_gpios(s5k6aa);
out_err2: out_err2:
...@@ -1635,7 +1633,6 @@ static int s5k6aa_remove(struct i2c_client *client) ...@@ -1635,7 +1633,6 @@ static int s5k6aa_remove(struct i2c_client *client)
v4l2_device_unregister_subdev(sd); v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(sd->ctrl_handler); v4l2_ctrl_handler_free(sd->ctrl_handler);
media_entity_cleanup(&sd->entity); media_entity_cleanup(&sd->entity);
regulator_bulk_free(S5K6AA_NUM_SUPPLIES, s5k6aa->supplies);
s5k6aa_free_gpios(s5k6aa); s5k6aa_free_gpios(s5k6aa);
return 0; return 0;
......
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