Skip to content

Commit

Permalink
[media] media: soc-camera: use managed devm_regulator_bulk_get()
Browse files Browse the repository at this point in the history
Using device-managed devm_regulator_bulk_get() eliminates the need to
release regulators explicitly.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Dec 20, 2012
1 parent 05efa71 commit c9a8d89
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/media/platform/soc_camera/soc_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,8 @@ static int soc_camera_probe(struct soc_camera_device *icd)
if (ret < 0)
return ret;

ret = regulator_bulk_get(icd->pdev, icl->num_regulators,
icl->regulators);
ret = devm_regulator_bulk_get(icd->pdev, icl->num_regulators,
icl->regulators);
if (ret < 0)
goto ereg;

Expand Down Expand Up @@ -1244,7 +1244,6 @@ static int soc_camera_probe(struct soc_camera_device *icd)
evdc:
ici->ops->remove(icd);
eadd:
regulator_bulk_free(icl->num_regulators, icl->regulators);
ereg:
v4l2_ctrl_handler_free(&icd->ctrl_handler);
return ret;
Expand Down Expand Up @@ -1278,8 +1277,6 @@ static int soc_camera_remove(struct soc_camera_device *icd)
}
soc_camera_free_user_formats(icd);

regulator_bulk_free(icl->num_regulators, icl->regulators);

return 0;
}

Expand Down

0 comments on commit c9a8d89

Please sign in to comment.