Currently devm_regulator_bulk_get() is called by soc-camera during host
driver probing, but regulators are attached to the camera platform
device, that is staying, independent whether the host probed successfully
or not. This can lead to repeated regulator requesting, if the host
driver is re-probed. Move the call to platform device probing to avoid
this.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
if (ret < 0)
return ret;
- ret = devm_regulator_bulk_get(icd->pdev, icl->num_regulators,
- icl->regulators);
- if (ret < 0)
- goto ereg;
-
/* The camera could have been already on, try to reset */
if (icl->reset)
icl->reset(icd->pdev);
ici->ops->remove(icd);
mutex_unlock(&ici->host_lock);
eadd:
-ereg:
v4l2_ctrl_handler_free(&icd->ctrl_handler);
return ret;
}
{
struct soc_camera_link *icl = pdev->dev.platform_data;
struct soc_camera_device *icd;
+ int ret;
if (!icl)
return -EINVAL;
if (!icd)
return -ENOMEM;
+ ret = devm_regulator_bulk_get(&pdev->dev, icl->num_regulators,
+ icl->regulators);
+ if (ret < 0)
+ return ret;
+
icd->iface = icl->bus_id;
icd->link = icl;
icd->pdev = &pdev->dev;