X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fw9966.c;h=4ab1267e104456b343a37b41ca2a5fcda59202a0;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=4c0a5bfb29132f9b894835fe24991a2a4d7c428f;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c index 4c0a5bfb2..4ab1267e1 100644 --- a/drivers/media/video/w9966.c +++ b/drivers/media/video/w9966.c @@ -179,7 +179,7 @@ static int w9966_i2c_rbyte(struct w9966_dev* cam); static int w9966_v4l_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static ssize_t w9966_v4l_read(struct file *file, char *buf, +static ssize_t w9966_v4l_read(struct file *file, char __user *buf, size_t count, loff_t *ppos); static struct file_operations w9966_fops = { @@ -555,6 +555,14 @@ static inline void w9966_i2c_setsda(struct w9966_dev* cam, int state) udelay(5); } +// Get peripheral clock line +// Expects a claimed pdev. +static inline int w9966_i2c_getscl(struct w9966_dev* cam) +{ + const unsigned char state = w9966_rReg(cam, 0x18); + return ((state & W9966_I2C_R_CLOCK) > 0); +} + // Sets the clock line on the i2c bus. // Expects a claimed pdev. -1 on error static inline int w9966_i2c_setscl(struct w9966_dev* cam, int state) @@ -588,14 +596,6 @@ static inline int w9966_i2c_getsda(struct w9966_dev* cam) return ((state & W9966_I2C_R_DATA) > 0); } -// Get peripheral clock line -// Expects a claimed pdev. -static inline int w9966_i2c_getscl(struct w9966_dev* cam) -{ - const unsigned char state = w9966_rReg(cam, 0x18); - return ((state & W9966_I2C_R_CLOCK) > 0); -} - // Write a byte with ack to the i2c bus. // Expects a claimed pdev. -1 on error static int w9966_i2c_wbyte(struct w9966_dev* cam, int data) @@ -867,13 +867,13 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file, } // Capture data -static ssize_t w9966_v4l_read(struct file *file, char *buf, +static ssize_t w9966_v4l_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct video_device *vdev = video_devdata(file); struct w9966_dev *cam = (struct w9966_dev *)vdev->priv; unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000 - unsigned char* dest = (unsigned char*)buf; + unsigned char __user *dest = (unsigned char __user *)buf; unsigned long dleft = count; unsigned char *tbuf;