diff options
author | Erik Andrén <erik.andren@gmail.com> | 2008-12-26 11:58:34 +0100 |
---|---|---|
committer | Erik Andrén <erik.andren@gmail.com> | 2008-12-26 11:58:34 +0100 |
commit | da1d0789d659be9f1d2568351f2b9f3d81345aed (patch) | |
tree | 71e1067d4024c066f1b7b651205a9cbc222691da /linux/drivers/media/video/bt8xx/bttv-driver.c | |
parent | cbd16cf5e7e4aae60ca283ad27bafae1fcb21102 (diff) | |
parent | ac2c9fd519acfcea10f4b1b17b69e9f3d8f49555 (diff) | |
download | mediapointer-dvb-s2-da1d0789d659be9f1d2568351f2b9f3d81345aed.tar.gz mediapointer-dvb-s2-da1d0789d659be9f1d2568351f2b9f3d81345aed.tar.bz2 |
Merge with the main gspca tree.
From: Erik Andrén <erik.andren@gmail.com>
Priority: normal
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-driver.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index 09188617b..e398de6c1 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -163,14 +163,22 @@ MODULE_LICENSE("GPL"); /* ----------------------------------------------------------------------- */ /* sysfs */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) static ssize_t show_card(struct device *cd, struct device_attribute *attr, char *buf) +#else +static ssize_t show_card(struct class_device *cd, char *buf) +#endif { struct video_device *vfd = container_of(cd, struct video_device, dev); struct bttv *btv = dev_get_drvdata(vfd->parent); return sprintf(buf, "%d\n", btv ? btv->c.type : UNSET); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) static DEVICE_ATTR(card, S_IRUGO, show_card, NULL); +#else +static CLASS_DEVICE_ATTR(card, S_IRUGO, show_card, NULL); +#endif /* ----------------------------------------------------------------------- */ /* dvb auto-load setup */ @@ -4089,7 +4097,7 @@ bttv_irq_switch_vbi(struct bttv *btv) spin_unlock(&btv->s_lock); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs) #else static irqreturn_t bttv_irq(int irq, void *dev_id) @@ -4271,8 +4279,13 @@ static int __devinit bttv_register_video(struct bttv *btv) goto err; printk(KERN_INFO "bttv%d: registered device video%d\n", btv->c.nr, btv->video_dev->num); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) + if (class_device_create_file(&btv->video_dev->dev, + &class_device_attr_card)<0) { +#else if (device_create_file(&btv->video_dev->dev, &dev_attr_card)<0) { +#endif printk(KERN_ERR "bttv%d: device_create_file 'card' " "failed\n", btv->c.nr); goto err; |