summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-dvb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-04-07 22:07:58 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 17:58:28 +0200
commit5013318ca4fd22e30fd891f234b60daa3ca2f62d (patch)
tree5aa4c5aa1b1c39463267d03c46635a7a732718d9 /drivers/media/video/em28xx/em28xx-dvb.c
parentV4L/DVB: cx88: fix setting input when using DVB (diff)
downloadlinux-5013318ca4fd22e30fd891f234b60daa3ca2f62d.tar.xz
linux-5013318ca4fd22e30fd891f234b60daa3ca2f62d.zip
V4L/DVB: em28xx: fix locks during dvb init sequence
Serialize DVB initialization, to avoid it to happen while analog initialization is still happening. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-dvb.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-dvb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index e7b3d5371558..cf1d8c3655fc 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -467,6 +467,7 @@ static int dvb_init(struct em28xx *dev)
}
dev->dvb = dvb;
+ mutex_lock(&dev->lock);
em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
/* init frontend */
switch (dev->model) {
@@ -590,15 +591,16 @@ static int dvb_init(struct em28xx *dev)
if (result < 0)
goto out_free;
- em28xx_set_mode(dev, EM28XX_SUSPEND);
em28xx_info("Successfully loaded em28xx-dvb\n");
- return 0;
+ret:
+ em28xx_set_mode(dev, EM28XX_SUSPEND);
+ mutex_unlock(&dev->lock);
+ return result;
out_free:
- em28xx_set_mode(dev, EM28XX_SUSPEND);
kfree(dvb);
dev->dvb = NULL;
- return result;
+ goto ret;
}
static int dvb_fini(struct em28xx *dev)