diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-17 15:53:31 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-17 15:53:31 +0200 |
commit | 5dd5b667fb09167143e1c49dea40b696f7f3ad52 (patch) | |
tree | 2b0bc6e4d02bdb78068e4822e06b9413b997bf7a /linux | |
parent | e52d2de8a0a347bfffa821dee2919bcef6ce5b39 (diff) | |
download | mediapointer-dvb-s2-5dd5b667fb09167143e1c49dea40b696f7f3ad52.tar.gz mediapointer-dvb-s2-5dd5b667fb09167143e1c49dea40b696f7f3ad52.tar.bz2 |
v4l-dvb: fix compilation issues for kernel 2.6.21
From: Hans Verkuil <hverkuil@xs4all.nl>
- fix unused function warnings in v4l2-i2c-drv.h and v4l2-i2c-drv-legacy.h
- fix ivtvfb.c compile warning that would in fact lead to an oops
- disable DVB_DRX397XD for kernels <= 2.6.21: it needs div64_64
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/ivtv/ivtvfb.c | 4 | ||||
-rw-r--r-- | linux/include/media/v4l2-i2c-drv-legacy.h | 23 | ||||
-rw-r--r-- | linux/include/media/v4l2-i2c-drv.h | 15 |
3 files changed, 24 insertions, 18 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtvfb.c b/linux/drivers/media/video/ivtv/ivtvfb.c index bdfda48e5..bdedff281 100644 --- a/linux/drivers/media/video/ivtv/ivtvfb.c +++ b/linux/drivers/media/video/ivtv/ivtvfb.c @@ -367,6 +367,7 @@ static int ivtvfb_prep_frame(struct ivtv *itv, int cmd, void __user *source, return ivtvfb_prep_dec_dma_to_device(itv, dest_offset, source, count); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) static ssize_t ivtvfb_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos) { @@ -448,6 +449,7 @@ static ssize_t ivtvfb_write(struct fb_info *info, const char __user *buf, return (err) ? err : count; } +#endif static int ivtvfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { @@ -909,7 +911,9 @@ static int ivtvfb_blank(int blank_mode, struct fb_info *info) static struct fb_ops ivtvfb_ops = { .owner = THIS_MODULE, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) .fb_write = ivtvfb_write, +#endif .fb_check_var = ivtvfb_check_var, .fb_set_par = ivtvfb_set_par, .fb_setcolreg = ivtvfb_setcolreg, diff --git a/linux/include/media/v4l2-i2c-drv-legacy.h b/linux/include/media/v4l2-i2c-drv-legacy.h index 31d6e103c..2887c53f7 100644 --- a/linux/include/media/v4l2-i2c-drv-legacy.h +++ b/linux/include/media/v4l2-i2c-drv-legacy.h @@ -37,7 +37,7 @@ struct v4l2_i2c_driver_data { }; static struct v4l2_i2c_driver_data v4l2_i2c_data; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) static const struct i2c_client_address_data addr_data; #else static struct i2c_client_address_data addr_data; @@ -77,25 +77,25 @@ static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client) return 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) static int v4l2_i2c_drv_suspend_helper(struct i2c_client *client, pm_message_t state) #else static int v4l2_i2c_drv_suspend_helper(struct device * dev, pm_message_t state) #endif { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) struct i2c_client *client = container_of(dev, struct i2c_client, dev); #endif return v4l2_i2c_data.suspend ? v4l2_i2c_data.suspend(client, state) : 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) static int v4l2_i2c_drv_resume_helper(struct i2c_client *client) #else static int v4l2_i2c_drv_resume_helper(struct device * dev) #endif { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) struct i2c_client *client = container_of(dev, struct i2c_client, dev); #endif return v4l2_i2c_data.resume ? v4l2_i2c_data.resume(client) : 0; @@ -107,14 +107,14 @@ static int v4l2_i2c_drv_resume_helper(struct device * dev) static struct i2c_driver v4l2_i2c_driver_legacy = { .driver = { .owner = THIS_MODULE, -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, #endif }, .attach_adapter = v4l2_i2c_drv_probe_legacy, .detach_client = v4l2_i2c_drv_detach_legacy, -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, #endif @@ -123,18 +123,19 @@ static struct i2c_driver v4l2_i2c_driver_legacy = { /* ----------------------------------------------------------------------- */ /* i2c implementation */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) static struct i2c_driver v4l2_i2c_driver = { .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, }; -#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) static int compat_legacy_probe(struct i2c_client *client) { return v4l2_i2c_data.probe(client, NULL); } #endif +#endif static int __init v4l2_i2c_drv_init(void) { @@ -151,7 +152,7 @@ static int __init v4l2_i2c_drv_init(void) v4l2_i2c_driver_legacy.command = v4l2_i2c_data.command; err = i2c_add_driver(&v4l2_i2c_driver_legacy); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) if (err) return err; v4l2_i2c_driver.driver.name = v4l2_i2c_data.name; @@ -176,7 +177,7 @@ static int __init v4l2_i2c_drv_init(void) static void __exit v4l2_i2c_drv_cleanup(void) { i2c_del_driver(&v4l2_i2c_driver_legacy); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) i2c_del_driver(&v4l2_i2c_driver); #endif } diff --git a/linux/include/media/v4l2-i2c-drv.h b/linux/include/media/v4l2-i2c-drv.h index 9333e56b3..734035ccf 100644 --- a/linux/include/media/v4l2-i2c-drv.h +++ b/linux/include/media/v4l2-i2c-drv.h @@ -44,13 +44,14 @@ struct v4l2_i2c_driver_data { static struct v4l2_i2c_driver_data v4l2_i2c_data; static struct i2c_driver v4l2_i2c_driver; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) static int compat_legacy_probe(struct i2c_client *client) { return v4l2_i2c_data.probe(client, NULL); } #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) /* Bus-based I2C implementation for kernels >= 2.6.22 */ @@ -111,25 +112,25 @@ static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client) return 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) static int v4l2_i2c_drv_suspend_helper(struct i2c_client *client, pm_message_t state) #else static int v4l2_i2c_drv_suspend_helper(struct device * dev, pm_message_t state) #endif { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) struct i2c_client *client = container_of(dev, struct i2c_client, dev); #endif return v4l2_i2c_data.suspend ? v4l2_i2c_data.suspend(client, state) : 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) static int v4l2_i2c_drv_resume_helper(struct i2c_client *client) #else static int v4l2_i2c_drv_resume_helper(struct device * dev) #endif { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) struct i2c_client *client = container_of(dev, struct i2c_client, dev); #endif return v4l2_i2c_data.resume ? v4l2_i2c_data.resume(client) : 0; @@ -140,14 +141,14 @@ static int v4l2_i2c_drv_resume_helper(struct device * dev) static struct i2c_driver v4l2_i2c_driver = { .driver = { .owner = THIS_MODULE, -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, #endif }, .attach_adapter = v4l2_i2c_drv_probe_legacy, .detach_client = v4l2_i2c_drv_detach_legacy, -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, #endif |