aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-01-03 09:21:02 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-01-04 22:35:54 -0500
commit8a97d4c11756ab6bab8582126d0f1b5c00b067ad (patch)
treeb8f5043edc341af33c67c886cf050db5ee362311
parent7d051b35d5196ad6011a17e751dbd3d180abb046 (diff)
[media] soc-camera: fix repeated regulator requesting
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>
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 1070a0c496d8..6552856ea59b 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1149,11 +1149,6 @@ static int soc_camera_probe(struct soc_camera_device *icd)
1149 if (ret < 0) 1149 if (ret < 0)
1150 return ret; 1150 return ret;
1151 1151
1152 ret = devm_regulator_bulk_get(icd->pdev, icl->num_regulators,
1153 icl->regulators);
1154 if (ret < 0)
1155 goto ereg;
1156
1157 /* The camera could have been already on, try to reset */ 1152 /* The camera could have been already on, try to reset */
1158 if (icl->reset) 1153 if (icl->reset)
1159 icl->reset(icd->pdev); 1154 icl->reset(icd->pdev);
@@ -1260,7 +1255,6 @@ evdc:
1260 ici->ops->remove(icd); 1255 ici->ops->remove(icd);
1261 mutex_unlock(&ici->host_lock); 1256 mutex_unlock(&ici->host_lock);
1262eadd: 1257eadd:
1263ereg:
1264 v4l2_ctrl_handler_free(&icd->ctrl_handler); 1258 v4l2_ctrl_handler_free(&icd->ctrl_handler);
1265 return ret; 1259 return ret;
1266} 1260}
@@ -1549,6 +1543,7 @@ static int __devinit soc_camera_pdrv_probe(struct platform_device *pdev)
1549{ 1543{
1550 struct soc_camera_link *icl = pdev->dev.platform_data; 1544 struct soc_camera_link *icl = pdev->dev.platform_data;
1551 struct soc_camera_device *icd; 1545 struct soc_camera_device *icd;
1546 int ret;
1552 1547
1553 if (!icl) 1548 if (!icl)
1554 return -EINVAL; 1549 return -EINVAL;
@@ -1557,6 +1552,11 @@ static int __devinit soc_camera_pdrv_probe(struct platform_device *pdev)
1557 if (!icd) 1552 if (!icd)
1558 return -ENOMEM; 1553 return -ENOMEM;
1559 1554
1555 ret = devm_regulator_bulk_get(&pdev->dev, icl->num_regulators,
1556 icl->regulators);
1557 if (ret < 0)
1558 return ret;
1559
1560 icd->iface = icl->bus_id; 1560 icd->iface = icl->bus_id;
1561 icd->link = icl; 1561 icd->link = icl;
1562 icd->pdev = &pdev->dev; 1562 icd->pdev = &pdev->dev;