summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/bt8xx/bttv-driver.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-10-08 16:26:13 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-08 16:26:13 -0300
commit789d51c810626c90641912d4d260295be0b57d87 (patch)
treec391a3d06174a1f31ea7e3185cf9f75718631d2e /linux/drivers/media/video/bt8xx/bttv-driver.c
parentbee12cc3dc8cc34a30ff03b084b809f5bfbb2217 (diff)
downloadmediapointer-dvb-s2-789d51c810626c90641912d4d260295be0b57d87.tar.gz
mediapointer-dvb-s2-789d51c810626c90641912d4d260295be0b57d87.tar.bz2
V4L: convert struct class_device to struct device
From: Kay Sievers <kay.sievers@vrfy.org> The currently used "struct class_device" will be removed from the kernel. Here is a patch that converts all users in drivers/media/video/ to struct device. Reviewed-by: Thierry Merle <thierry.merle@free.fr> Reviewed-by: Mike Isely <isely@pobox.com> Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Diffstat (limited to 'linux/drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-driver.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c
index 81bb9fe9b..99cb475cd 100644
--- a/linux/drivers/media/video/bt8xx/bttv-driver.c
+++ b/linux/drivers/media/video/bt8xx/bttv-driver.c
@@ -166,13 +166,18 @@ MODULE_LICENSE("GPL");
/* sysfs */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+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 = to_video_device(cd);
struct bttv *btv = dev_get_drvdata(vfd->dev);
return sprintf(buf, "%d\n", btv ? btv->c.type : UNSET);
}
-static CLASS_DEVICE_ATTR(card, S_IRUGO, show_card, NULL);
+static DEVICE_ATTR(card, S_IRUGO, show_card, NULL);
#endif
/* ----------------------------------------------------------------------- */
@@ -4664,9 +4669,9 @@ 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->minor & 0x1f);
- if (class_device_create_file(&btv->video_dev->class_dev,
- &class_device_attr_card)<0) {
- printk(KERN_ERR "bttv%d: class_device_create_file 'card' "
+ if (device_create_file(&btv->video_dev->class_dev,
+ &dev_attr_card)<0) {
+ printk(KERN_ERR "bttv%d: device_create_file 'card' "
"failed\n", btv->c.nr);
goto err;
}