include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / media / dvb / ttpci / av7110_ca.c
index dd9aee3..ac7779c 100644 (file)
  */
 
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/fs.h>
 #include <linux/timer.h>
 #include <linux/poll.h>
-#include <linux/smp_lock.h>
+#include <linux/gfp.h>
 
 #include "av7110.h"
 #include "av7110_hw.h"
@@ -153,7 +152,7 @@ static ssize_t ci_ll_write(struct dvb_ringbuffer *cibuf, struct file *file,
 {
        int free;
        int non_blocking = file->f_flags & O_NONBLOCK;
-       char *page = (char *)__get_free_page(GFP_USER);
+       u8 *page = (u8 *)__get_free_page(GFP_USER);
        int res;
 
        if (!page)
@@ -210,13 +209,13 @@ static ssize_t ci_ll_read(struct dvb_ringbuffer *cibuf, struct file *file,
                return -EINVAL;
        DVB_RINGBUFFER_SKIP(cibuf, 2);
 
-       return dvb_ringbuffer_read(cibuf, buf, len, 1);
+       return dvb_ringbuffer_read_user(cibuf, buf, len);
 }
 
 static int dvb_ca_open(struct inode *inode, struct file *file)
 {
-       struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
-       struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+       struct dvb_device *dvbdev = file->private_data;
+       struct av7110 *av7110 = dvbdev->priv;
        int err = dvb_generic_open(inode, file);
 
        dprintk(8, "av7110:%p\n",av7110);
@@ -229,8 +228,8 @@ static int dvb_ca_open(struct inode *inode, struct file *file)
 
 static unsigned int dvb_ca_poll (struct file *file, poll_table *wait)
 {
-       struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
-       struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+       struct dvb_device *dvbdev = file->private_data;
+       struct av7110 *av7110 = dvbdev->priv;
        struct dvb_ringbuffer *rbuf = &av7110->ci_rbuffer;
        struct dvb_ringbuffer *wbuf = &av7110->ci_wbuffer;
        unsigned int mask = 0;
@@ -252,8 +251,8 @@ static unsigned int dvb_ca_poll (struct file *file, poll_table *wait)
 static int dvb_ca_ioctl(struct inode *inode, struct file *file,
                 unsigned int cmd, void *parg)
 {
-       struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
-       struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+       struct dvb_device *dvbdev = file->private_data;
+       struct av7110 *av7110 = dvbdev->priv;
        unsigned long arg = (unsigned long) parg;
 
        dprintk(8, "av7110:%p\n",av7110);
@@ -330,8 +329,8 @@ static int dvb_ca_ioctl(struct inode *inode, struct file *file,
 static ssize_t dvb_ca_write(struct file *file, const char __user *buf,
                            size_t count, loff_t *ppos)
 {
-       struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
-       struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+       struct dvb_device *dvbdev = file->private_data;
+       struct av7110 *av7110 = dvbdev->priv;
 
        dprintk(8, "av7110:%p\n",av7110);
        return ci_ll_write(&av7110->ci_wbuffer, file, buf, count, ppos);
@@ -340,16 +339,14 @@ static ssize_t dvb_ca_write(struct file *file, const char __user *buf,
 static ssize_t dvb_ca_read(struct file *file, char __user *buf,
                           size_t count, loff_t *ppos)
 {
-       struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
-       struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
+       struct dvb_device *dvbdev = file->private_data;
+       struct av7110 *av7110 = dvbdev->priv;
 
        dprintk(8, "av7110:%p\n",av7110);
        return ci_ll_read(&av7110->ci_rbuffer, file, buf, count, ppos);
 }
 
-
-
-static struct file_operations dvb_ca_fops = {
+static const struct file_operations dvb_ca_fops = {
        .owner          = THIS_MODULE,
        .read           = dvb_ca_read,
        .write          = dvb_ca_write,