summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/bt8xx/bttv-driver.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-11-22 21:37:57 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-11-22 21:37:57 -0200
commitb0d6553d68b8a1ffded1620af3daf811d387fa31 (patch)
tree19022b9ab1ffed4e02afa6d1df51387e396e31dc /linux/drivers/media/video/bt8xx/bttv-driver.c
parent431a2d54bfc4ff45db203d48565c0557792a5fcb (diff)
downloadmediapointer-dvb-s2-b0d6553d68b8a1ffded1620af3daf811d387fa31.tar.gz
mediapointer-dvb-s2-b0d6553d68b8a1ffded1620af3daf811d387fa31.tar.bz2
Remove warnings when compiling with kernel 2.6.18
From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-driver.c15
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;