diff options
Diffstat (limited to 'linux/drivers/media/common')
-rw-r--r-- | linux/drivers/media/common/saa7146_core.c | 14 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_fops.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_i2c.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_video.c | 4 |
4 files changed, 6 insertions, 20 deletions
diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c index 55a93a805..45e7eec45 100644 --- a/linux/drivers/media/common/saa7146_core.c +++ b/linux/drivers/media/common/saa7146_core.c @@ -187,11 +187,7 @@ void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data) /********************************************************************************/ /* interrupt handler */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static void interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) -#else static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) -#endif { struct saa7146_dev *dev = (struct saa7146_dev*)dev_id; u32 isr = 0; @@ -202,11 +198,7 @@ static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) /* is this our interrupt? */ if ( 0 == isr ) { /* nope, some other device */ -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) - return IRQ_RETVAL(0); -#else - return; -#endif + return IRQ_NONE; } saa7146_write(dev, ISR, isr); @@ -256,9 +248,7 @@ static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) ERR(("disabling interrupt source(s)!\n")); IER_DISABLE(dev,isr); } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) - return IRQ_RETVAL(1); -#endif + return IRQ_HANDLED; } /*********************************************************************************/ diff --git a/linux/drivers/media/common/saa7146_fops.c b/linux/drivers/media/common/saa7146_fops.c index b428043bd..709c9b8d9 100644 --- a/linux/drivers/media/common/saa7146_fops.c +++ b/linux/drivers/media/common/saa7146_fops.c @@ -427,7 +427,7 @@ int saa7146_register_device(struct video_device *vid, struct saa7146_dev* dev, c DEB_EE(("dev:%p, name:'%s'\n",dev,name)); *vid = device_template; - strncpy(vid->name, name, 32); + strlcpy(vid->name, name, sizeof(vid->name)); vid->priv = dev; // fixme: -1 should be an insmod parameter *for the extension* (like "video_nr"); diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index d6b92ac2f..535cd55ba 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -378,10 +378,6 @@ int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) { struct saa7146_dev* dev = i2c_get_adapdata(adapter); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - DEB_I2C(("adapter: '%s'.\n", adapter->name)); -#endif - /* use helper function to transfer data */ return saa7146_i2c_transfer(dev, msg, num, adapter->retries); } @@ -411,7 +407,7 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c memset(i2c_adapter,0,sizeof(struct i2c_adapter)); #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) strcpy(i2c_adapter->name, dev->name); - i2c_adapter->data = dev; + i2c_adapter->data = dev; #else strcpy(i2c_adapter->dev.name, dev->name); i2c_set_adapdata(i2c_adapter,dev); diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index 7cacfcbdd..a5cab8eac 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -802,7 +802,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int DEB_EE(("VIDIOC_QUERYCAP\n")); strcpy(cap->driver, "saa7146 v4l2"); - strncpy(cap->card, dev->ext->name, sizeof(cap->card)); + strlcpy(cap->card, dev->ext->name, sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s",dev->pci->slot_name); cap->version = SAA7146_VERSION_CODE; cap->capabilities = @@ -869,7 +869,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int } memset(f,0,sizeof(*f)); f->index = index; - strncpy(f->description,formats[index].name,31); + strlcpy(f->description,formats[index].name,sizeof(f->description)); f->pixelformat = formats[index].pixelformat; break; } |