diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-07-22 11:52:40 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 21:03:20 -0400 |
commit | c976bc82339437e840f7dbf0b8c89c09d3fcd75e (patch) | |
tree | a8e48cead1f061340fe19890fde43d880c26b92a /drivers/media/video/ivtv/ivtv-fileops.c | |
parent | fa8a7529ba8c3c2f87dec78ad32c388695f4c1b7 (diff) |
V4L/DVB (5922): ivtv, cx25840: postpone fw load until first use
The firmware is now loaded when the driver is actually used for the first
time. This allows the driver to be compiled in-kernel instead of as a module.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-fileops.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-fileops.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index 66ea3cbc369c..498860841644 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c | |||
@@ -850,6 +850,15 @@ int ivtv_v4l2_open(struct inode *inode, struct file *filp) | |||
850 | return -ENXIO; | 850 | return -ENXIO; |
851 | } | 851 | } |
852 | 852 | ||
853 | if (!test_and_set_bit(IVTV_F_I_INITED, &itv->i_flags)) | ||
854 | if (ivtv_init_on_first_open(itv)) | ||
855 | set_bit(IVTV_F_I_FAILED, &itv->i_flags); | ||
856 | |||
857 | if (test_bit(IVTV_F_I_FAILED, &itv->i_flags)) { | ||
858 | printk(KERN_WARNING "ivtv: failed to initialize on minor %d\n", minor); | ||
859 | return -ENXIO; | ||
860 | } | ||
861 | |||
853 | if (y == IVTV_DEC_STREAM_TYPE_MPG && | 862 | if (y == IVTV_DEC_STREAM_TYPE_MPG && |
854 | test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_YUV].s_flags)) | 863 | test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_YUV].s_flags)) |
855 | return -EBUSY; | 864 | return -EBUSY; |