]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/bt8xx/bttv-driver.c
V4L/DVB (6293): V4L: convert struct class_device to struct device
[linux-2.6-omap-h63xx.git] / drivers / media / video / bt8xx / bttv-driver.c
index cb555f2c40f95802749ae5ac791d4f68eb7e7e5d..49278537eec4bbd9122b1567297046fe5421b9b8 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <linux/init.h>
 #include <linux/module.h>
-#include <linux/moduleparam.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
@@ -155,13 +154,14 @@ MODULE_LICENSE("GPL");
 /* ----------------------------------------------------------------------- */
 /* sysfs                                                                   */
 
-static ssize_t show_card(struct class_device *cd, char *buf)
+static ssize_t show_card(struct device *cd,
+                        struct device_attribute *attr, char *buf)
 {
        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);
 
 /* ----------------------------------------------------------------------- */
 /* dvb auto-load setup                                                     */
@@ -2583,7 +2583,7 @@ static int setup_window(struct bttv_fh *fh, struct bttv *btv,
        if (check_btres(fh, RESOURCE_OVERLAY)) {
                struct bttv_buffer *new;
 
-               new = videobuf_alloc(sizeof(*new));
+               new = videobuf_pci_alloc(sizeof(*new));
                new->crop = btv->crop[!!fh->do_crop].rect;
                bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
                retval = bttv_switch_overlay(btv,fh,new);
@@ -3049,7 +3049,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
                mutex_lock(&fh->cap.lock);
                if (*on) {
                        fh->ov.tvnorm = btv->tvnorm;
-                       new = videobuf_alloc(sizeof(*new));
+                       new = videobuf_pci_alloc(sizeof(*new));
                        new->crop = btv->crop[!!fh->do_crop].rect;
                        bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
                } else {
@@ -3142,9 +3142,12 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
                        retval = -EIO;
                        /* fall through */
                case STATE_DONE:
-                       videobuf_dma_sync(&fh->cap,&buf->vb.dma);
+               {
+                       struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
+                       videobuf_dma_sync(&fh->cap,dma);
                        bttv_dma_free(&fh->cap,btv,buf);
                        break;
+               }
                default:
                        retval = -EINVAL;
                        break;
@@ -3338,7 +3341,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
                        if (check_btres(fh, RESOURCE_OVERLAY)) {
                                struct bttv_buffer *new;
 
-                               new = videobuf_alloc(sizeof(*new));
+                               new = videobuf_pci_alloc(sizeof(*new));
                                new->crop = btv->crop[!!fh->do_crop].rect;
                                bttv_overlay_risc(btv,&fh->ov,fh->ovfmt,new);
                                retval = bttv_switch_overlay(btv,fh,new);
@@ -3697,7 +3700,7 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
                                mutex_unlock(&fh->cap.lock);
                                return POLLERR;
                        }
-                       fh->cap.read_buf = videobuf_alloc(fh->cap.msize);
+                       fh->cap.read_buf = videobuf_pci_alloc(fh->cap.msize);
                        if (NULL == fh->cap.read_buf) {
                                mutex_unlock(&fh->cap.lock);
                                return POLLERR;
@@ -3764,13 +3767,13 @@ static int bttv_open(struct inode *inode, struct file *file)
        fh->ov.setup_ok = 0;
        v4l2_prio_open(&btv->prio,&fh->prio);
 
-       videobuf_queue_init(&fh->cap, &bttv_video_qops,
+       videobuf_queue_pci_init(&fh->cap, &bttv_video_qops,
                            btv->c.pci, &btv->s_lock,
                            V4L2_BUF_TYPE_VIDEO_CAPTURE,
                            V4L2_FIELD_INTERLACED,
                            sizeof(struct bttv_buffer),
                            fh);
-       videobuf_queue_init(&fh->vbi, &bttv_vbi_qops,
+       videobuf_queue_pci_init(&fh->vbi, &bttv_vbi_qops,
                            btv->c.pci, &btv->s_lock,
                            V4L2_BUF_TYPE_VBI_CAPTURE,
                            V4L2_FIELD_SEQ_TB,
@@ -4613,9 +4616,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;
        }