提交 c9a8d896 编写于 作者: G Guennadi Liakhovetski 提交者: Mauro Carvalho Chehab

[media] media: soc-camera: use managed devm_regulator_bulk_get()

Using device-managed devm_regulator_bulk_get() eliminates the need to
release regulators explicitly.
Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 05efa71b
......@@ -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;
......@@ -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;
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册