Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295106
b: refs/heads/master
c: 7705b6d
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Mar 20, 2012
1 parent 33f3c7f commit 28d9a9d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5da6e984805786c4d96498e1c51e971007dea6dc
refs/heads/master: 7705b6d8eac89067e5177835468c99e71e2cd40c
32 changes: 16 additions & 16 deletions trunk/drivers/media/video/soc_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,6 @@ static int soc_camera_open(struct file *file)
},
};

ret = soc_camera_power_on(icd, icl);
if (ret < 0)
goto epower;

/* The camera could have been already on, try to reset */
if (icl->reset)
icl->reset(icd->pdev);
Expand All @@ -540,6 +536,10 @@ static int soc_camera_open(struct file *file)
goto eiciadd;
}

ret = soc_camera_power_on(icd, icl);
if (ret < 0)
goto epower;

pm_runtime_enable(&icd->vdev->dev);
ret = pm_runtime_resume(&icd->vdev->dev);
if (ret < 0 && ret != -ENOSYS)
Expand Down Expand Up @@ -578,10 +578,10 @@ static int soc_camera_open(struct file *file)
esfmt:
pm_runtime_disable(&icd->vdev->dev);
eresume:
ici->ops->remove(icd);
eiciadd:
soc_camera_power_off(icd, icl);
epower:
ici->ops->remove(icd);
eiciadd:
icd->use_count--;
module_put(ici->ops->owner);

Expand Down Expand Up @@ -1050,6 +1050,14 @@ static int soc_camera_probe(struct soc_camera_device *icd)
if (ret < 0)
goto ereg;

/* The camera could have been already on, try to reset */
if (icl->reset)
icl->reset(icd->pdev);

ret = ici->ops->add(icd);
if (ret < 0)
goto eadd;

/*
* This will not yet call v4l2_subdev_core_ops::s_power(1), because the
* subdevice has not been initialised yet. We'll have to call it once
Expand All @@ -1060,14 +1068,6 @@ static int soc_camera_probe(struct soc_camera_device *icd)
if (ret < 0)
goto epower;

/* The camera could have been already on, try to reset */
if (icl->reset)
icl->reset(icd->pdev);

ret = ici->ops->add(icd);
if (ret < 0)
goto eadd;

/* Must have icd->vdev before registering the device */
ret = video_dev_create(icd);
if (ret < 0)
Expand Down Expand Up @@ -1165,10 +1165,10 @@ static int soc_camera_probe(struct soc_camera_device *icd)
video_device_release(icd->vdev);
icd->vdev = NULL;
evdc:
ici->ops->remove(icd);
eadd:
soc_camera_power_off(icd, icl);
epower:
ici->ops->remove(icd);
eadd:
regulator_bulk_free(icl->num_regulators, icl->regulators);
ereg:
v4l2_ctrl_handler_free(&icd->ctrl_handler);
Expand Down

0 comments on commit 28d9a9d

Please sign in to comment.