aboutsummaryrefslogtreecommitdiffstats
path: root/bttv/driver/videodev.c
diff options
context:
space:
mode:
Diffstat (limited to 'bttv/driver/videodev.c')
-rw-r--r--bttv/driver/videodev.c57
1 files changed, 45 insertions, 12 deletions
diff --git a/bttv/driver/videodev.c b/bttv/driver/videodev.c
index 4e5aa47..360058c 100644
--- a/bttv/driver/videodev.c
+++ b/bttv/driver/videodev.c
@@ -50,6 +50,15 @@ extern int init_colour_qcams(struct video_init *);
#ifdef CONFIG_VIDEO_BWQCAM
extern int init_bw_qcams(struct video_init *);
#endif
+#ifdef CONFIG_RADIO_AZTECH
+extern int aztech_init(struct video_init *);
+#endif
+#ifdef CONFIG_RADIO_RTRACK
+extern int rtrack_init(struct video_init *);
+#endif
+#ifdef CONFIG_RADIO_SF16FMI
+extern int fmi_init(struct video_init *);
+#endif
static struct video_init video_init_list[]={
#ifdef CONFIG_VIDEO_BT848
@@ -68,6 +77,15 @@ static struct video_init video_init_list[]={
{"PMS", init_pms_cards},
#endif
{"end", NULL}
+#ifdef CONFIG_RADIO_AZTECH
+ {"Aztech", aztech_init},
+#endif
+#ifdef CONFIG_RADIO_RTRACK
+ {"RTrack", rtrack_init},
+#endif
+#ifdef CONFIG_RADIO_SF16FMI
+ {"SF16FMI", fmi_init},
+#endif
};
#if LINUX_VERSION_CODE >= 0x020100
@@ -79,7 +97,10 @@ static ssize_t video_read(struct file *file,
char *buf, size_t count, loff_t *ppos)
{
struct video_device *vfl=video_device[MINOR(file->f_dentry->d_inode->i_rdev)];
- return vfl->read(vfl, buf, count, file->f_flags&O_NONBLOCK);
+ if (vfl->read)
+ return vfl->read(vfl, buf, count, file->f_flags&O_NONBLOCK);
+ else
+ return -EINVAL;
}
@@ -93,15 +114,21 @@ static ssize_t video_write(struct file *file, const char *buf,
size_t count, loff_t *ppos)
{
struct video_device *vfl=video_device[MINOR(file->f_dentry->d_inode->i_rdev)];
- return vfl->write(vfl, buf, count, file->f_flags&O_NONBLOCK);
+ if (vfl->write)
+ return vfl->write(vfl, buf, count, file->f_flags&O_NONBLOCK);
+ else
+ return 0;
}
#else
static int video_read(struct inode *ino,struct file *file,
char *buf, int count)
{
- int err;
- struct video_device *vfl=video_device[MINOR(ino->i_rdev)];
- return vfl->read(vfl, buf, count, file->f_flags&O_NONBLOCK);
+ int err;
+ struct video_device *vfl=video_device[MINOR(ino->i_rdev)];
+ if (vfl->read)
+ return vfl->read(vfl, buf, count, file->f_flags&O_NONBLOCK);
+ else
+ return -EINVAL;
}
static int video_write(struct inode *ino,struct file *file, const char *buf,
@@ -109,7 +136,10 @@ static int video_write(struct inode *ino,struct file *file, const char *buf,
{
int err;
struct video_device *vfl=video_device[MINOR(ino->i_rdev)];
- return vfl->write(vfl, buf, count, file->f_flags&O_NONBLOCK);
+ if (vfl->write)
+ return vfl->write(vfl, buf, count, file->f_flags&O_NONBLOCK);
+ else
+ return 0;
}
#endif
@@ -257,12 +287,15 @@ int video_register_device(struct video_device *vfd, int type)
/* The init call may sleep so we book the slot out
then call */
MOD_INC_USE_COUNT;
- err=vfd->initialize(vfd);
- if(err<0)
- {
- video_device[i]=NULL;
- MOD_DEC_USE_COUNT;
- return err;
+ if (vfd->initialize)
+ {
+ err=vfd->initialize(vfd);
+ if(err<0)
+ {
+ video_device[i]=NULL;
+ MOD_DEC_USE_COUNT;
+ return err;
+ }
}
return 0;
}

Privacy Policy