Skip to content

Commit

Permalink
V4L/DVB (13646): sh_mobile_ceu_camera: do not mark host occupied, whe…
Browse files Browse the repository at this point in the history
…n adding a client fails

Currently, if resetting the host interface, when adding a new client, fails, a
negative error code is returned, but the host is still marked as occupied. Fix
this bug.

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 16, 2009
1 parent 5d28d52 commit 6ed7c03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/media/video/sh_mobile_ceu_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ static int sh_mobile_ceu_add_device(struct soc_camera_device *icd)
{
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct sh_mobile_ceu_dev *pcdev = ici->priv;
int ret;

if (pcdev->icd)
return -EBUSY;
Expand All @@ -469,9 +470,11 @@ static int sh_mobile_ceu_add_device(struct soc_camera_device *icd)

pm_runtime_get_sync(ici->v4l2_dev.dev);

pcdev->icd = icd;
ret = sh_mobile_ceu_soft_reset(pcdev);
if (!ret)
pcdev->icd = icd;

return sh_mobile_ceu_soft_reset(pcdev);
return ret;
}

/* Called with .video_lock held */
Expand Down

0 comments on commit 6ed7c03

Please sign in to comment.