diff options
author | Hans Verkuil <devnull@localhost> | 2005-11-27 00:31:22 +0000 |
---|---|---|
committer | Hans Verkuil <devnull@localhost> | 2005-11-27 00:31:22 +0000 |
commit | b378c9b9b9480ef6352bc5f37e30369dda75625e (patch) | |
tree | 1c54fb20bc99627ed4ab57d1456aaa5818ceed1b /linux/drivers/media | |
parent | ecc615b56853187aabee05db0948691dec891f45 (diff) | |
download | mediapointer-dvb-s2-b378c9b9b9480ef6352bc5f37e30369dda75625e.tar.gz mediapointer-dvb-s2-b378c9b9b9480ef6352bc5f37e30369dda75625e.tar.bz2 |
Fix suspend/resume 2.6.15 compile warnings
Fix suspend/resume 2.6.15 compile warnings.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/msp3400-driver.c | 107 | ||||
-rw-r--r-- | linux/drivers/media/video/msp3400.c | 107 | ||||
-rw-r--r-- | linux/drivers/media/video/tda9887.c | 13 | ||||
-rw-r--r-- | linux/drivers/media/video/tuner-core.c | 14 |
4 files changed, 113 insertions, 128 deletions
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index 1f5f50a05..626bd8860 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -182,6 +182,9 @@ struct msp3400c { #define MSP3400_MAX 4 static struct i2c_client *msps[MSP3400_MAX]; +/* defined at the end of the source */ +extern struct i2c_client client_template; + #define VIDEO_MODE_RADIO 16 /* norm magic for radio mode */ /* ---------------------------------------------------------------------- */ @@ -1580,52 +1583,17 @@ static void msp34xxg_set_audmode(struct i2c_client *client, int audmode) /* ----------------------------------------------------------------------- */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -static int msp_attach(struct i2c_adapter *adap, int addr, int kind); -#else -static int msp_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind); -#endif -static int msp_detach(struct i2c_client *client); -static int msp_probe(struct i2c_adapter *adap); -static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) -static int msp_suspend(struct device * dev, pm_message_t state, u32 level); -#else -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -static int msp_suspend(struct device * dev, u32 state, u32 level); -#endif -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -static int msp_resume(struct device * dev, u32 level); -#endif - -static void msp_wake_thread(struct i2c_client *client); - -static struct i2c_driver driver = { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) - .owner = THIS_MODULE, -#endif - .name = "msp3400", - .id = I2C_DRIVERID_MSP3400, - .flags = I2C_DF_NOTIFY, - .attach_adapter = msp_probe, - .detach_client = msp_detach, - .command = msp_command, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) - .driver = { - .suspend = msp_suspend, - .resume = msp_resume, - }, -#endif -}; - -static struct i2c_client client_template = +static void msp_wake_thread(struct i2c_client *client) { - .name = "(unset)", - .flags = I2C_CLIENT_ALLOW_USE, - .driver = &driver, -}; + struct msp3400c *msp = i2c_get_clientdata(client); + + if (NULL == msp->kthread) + return; + msp3400c_setvolume(client,msp->muted,0,0); + msp->watch_stereo = 0; + msp->restart = 1; + wake_up_interruptible(&msp->wq); +} #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_attach(struct i2c_adapter *adap, int addr, int kind) @@ -1810,18 +1778,6 @@ static int msp_probe(struct i2c_adapter *adap) #endif } -static void msp_wake_thread(struct i2c_client *client) -{ - struct msp3400c *msp = i2c_get_clientdata(client); - - if (NULL == msp->kthread) - return; - msp3400c_setvolume(client,msp->muted,0,0); - msp->watch_stereo = 0; - msp->restart = 1; - wake_up_interruptible(&msp->wq); -} - /* ----------------------------------------------------------------------- */ static int mode_v4l2_to_v4l1(int rxsubchans) @@ -2259,14 +2215,14 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) return 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14) +static int msp_suspend(struct device * dev, pm_message_t state) +#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) static int msp_suspend(struct device * dev, pm_message_t state, u32 level) #else -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_suspend(struct device * dev, u32 state, u32 level) #endif -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) { struct i2c_client *client = container_of(dev, struct i2c_client, dev); @@ -2275,7 +2231,11 @@ static int msp_suspend(struct device * dev, u32 state, u32 level) return 0; } +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14) +static int msp_resume(struct device * dev) +#else static int msp_resume(struct device * dev, u32 level) +#endif { struct i2c_client *client = container_of(dev, struct i2c_client, dev); @@ -2286,6 +2246,31 @@ static int msp_resume(struct device * dev, u32 level) #endif /* LINUX_VERSION_CODE */ /* ----------------------------------------------------------------------- */ +static struct i2c_driver driver = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) + .owner = THIS_MODULE, +#endif + .name = "msp3400", + .id = I2C_DRIVERID_MSP3400, + .flags = I2C_DF_NOTIFY, + .attach_adapter = msp_probe, + .detach_client = msp_detach, + .command = msp_command, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + .driver = { + .suspend = msp_suspend, + .resume = msp_resume, + }, +#endif +}; + +static struct i2c_client client_template = +{ + .name = "(unset)", + .flags = I2C_CLIENT_ALLOW_USE, + .driver = &driver, +}; + static int __init msp3400_init_module(void) { return i2c_add_driver(&driver); diff --git a/linux/drivers/media/video/msp3400.c b/linux/drivers/media/video/msp3400.c index 1f5f50a05..626bd8860 100644 --- a/linux/drivers/media/video/msp3400.c +++ b/linux/drivers/media/video/msp3400.c @@ -182,6 +182,9 @@ struct msp3400c { #define MSP3400_MAX 4 static struct i2c_client *msps[MSP3400_MAX]; +/* defined at the end of the source */ +extern struct i2c_client client_template; + #define VIDEO_MODE_RADIO 16 /* norm magic for radio mode */ /* ---------------------------------------------------------------------- */ @@ -1580,52 +1583,17 @@ static void msp34xxg_set_audmode(struct i2c_client *client, int audmode) /* ----------------------------------------------------------------------- */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -static int msp_attach(struct i2c_adapter *adap, int addr, int kind); -#else -static int msp_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind); -#endif -static int msp_detach(struct i2c_client *client); -static int msp_probe(struct i2c_adapter *adap); -static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) -static int msp_suspend(struct device * dev, pm_message_t state, u32 level); -#else -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -static int msp_suspend(struct device * dev, u32 state, u32 level); -#endif -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -static int msp_resume(struct device * dev, u32 level); -#endif - -static void msp_wake_thread(struct i2c_client *client); - -static struct i2c_driver driver = { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) - .owner = THIS_MODULE, -#endif - .name = "msp3400", - .id = I2C_DRIVERID_MSP3400, - .flags = I2C_DF_NOTIFY, - .attach_adapter = msp_probe, - .detach_client = msp_detach, - .command = msp_command, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) - .driver = { - .suspend = msp_suspend, - .resume = msp_resume, - }, -#endif -}; - -static struct i2c_client client_template = +static void msp_wake_thread(struct i2c_client *client) { - .name = "(unset)", - .flags = I2C_CLIENT_ALLOW_USE, - .driver = &driver, -}; + struct msp3400c *msp = i2c_get_clientdata(client); + + if (NULL == msp->kthread) + return; + msp3400c_setvolume(client,msp->muted,0,0); + msp->watch_stereo = 0; + msp->restart = 1; + wake_up_interruptible(&msp->wq); +} #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_attach(struct i2c_adapter *adap, int addr, int kind) @@ -1810,18 +1778,6 @@ static int msp_probe(struct i2c_adapter *adap) #endif } -static void msp_wake_thread(struct i2c_client *client) -{ - struct msp3400c *msp = i2c_get_clientdata(client); - - if (NULL == msp->kthread) - return; - msp3400c_setvolume(client,msp->muted,0,0); - msp->watch_stereo = 0; - msp->restart = 1; - wake_up_interruptible(&msp->wq); -} - /* ----------------------------------------------------------------------- */ static int mode_v4l2_to_v4l1(int rxsubchans) @@ -2259,14 +2215,14 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) return 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14) +static int msp_suspend(struct device * dev, pm_message_t state) +#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) static int msp_suspend(struct device * dev, pm_message_t state, u32 level) #else -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_suspend(struct device * dev, u32 state, u32 level) #endif -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) { struct i2c_client *client = container_of(dev, struct i2c_client, dev); @@ -2275,7 +2231,11 @@ static int msp_suspend(struct device * dev, u32 state, u32 level) return 0; } +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14) +static int msp_resume(struct device * dev) +#else static int msp_resume(struct device * dev, u32 level) +#endif { struct i2c_client *client = container_of(dev, struct i2c_client, dev); @@ -2286,6 +2246,31 @@ static int msp_resume(struct device * dev, u32 level) #endif /* LINUX_VERSION_CODE */ /* ----------------------------------------------------------------------- */ +static struct i2c_driver driver = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) + .owner = THIS_MODULE, +#endif + .name = "msp3400", + .id = I2C_DRIVERID_MSP3400, + .flags = I2C_DF_NOTIFY, + .attach_adapter = msp_probe, + .detach_client = msp_detach, + .command = msp_command, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + .driver = { + .suspend = msp_suspend, + .resume = msp_resume, + }, +#endif +}; + +static struct i2c_client client_template = +{ + .name = "(unset)", + .flags = I2C_CLIENT_ALLOW_USE, + .driver = &driver, +}; + static int __init msp3400_init_module(void) { return i2c_add_driver(&driver); diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index e918216ff..841e5d109 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -841,14 +841,14 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg) return 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14) +static int tda9887_suspend(struct device * dev, pm_message_t state) +#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) static int tda9887_suspend(struct device * dev, pm_message_t state, u32 level) #else -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) static int tda9887_suspend(struct device * dev, u32 state, u32 level) #endif -#endif -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) { struct i2c_client *c = container_of(dev, struct i2c_client, dev); struct tda9887 *t = i2c_get_clientdata(c); @@ -857,7 +857,11 @@ static int tda9887_suspend(struct device * dev, u32 state, u32 level) return 0; } +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14) +static int tda9887_resume(struct device * dev) +#else static int tda9887_resume(struct device * dev, u32 level) +#endif { struct i2c_client *c = container_of(dev, struct i2c_client, dev); struct tda9887 *t = i2c_get_clientdata(c); @@ -867,6 +871,7 @@ static int tda9887_resume(struct device * dev, u32 level) return 0; } #endif + /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index c459a42f2..e40a7a750 100644 --- a/linux/drivers/media/video/tuner-core.c +++ b/linux/drivers/media/video/tuner-core.c @@ -1,5 +1,5 @@ /* - * $Id: tuner-core.c,v 1.85 2005/11/09 00:17:20 mchehab Exp $ + * $Id: tuner-core.c,v 1.86 2005/11/27 00:31:22 hverkuil Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -732,7 +732,10 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) return 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14) +static int tuner_suspend(struct device *dev, pm_message_t state) +#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) static int tuner_suspend(struct device *dev, pm_message_t state, u32 level) #else static int tuner_suspend(struct device *dev, u32 state, u32 level) @@ -746,7 +749,11 @@ static int tuner_suspend(struct device *dev, u32 state, u32 level) return 0; } +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14) +static int tuner_resume(struct device *dev) +#else static int tuner_resume(struct device *dev, u32 level) +#endif { struct i2c_client *c = container_of (dev, struct i2c_client, dev); struct tuner *t = i2c_get_clientdata (c); @@ -756,6 +763,7 @@ static int tuner_resume(struct device *dev, u32 level) set_freq(c, t->freq); return 0; } +#endif /* ----------------------------------------------------------------------- */ @@ -767,10 +775,12 @@ static struct i2c_driver driver = { .attach_adapter = tuner_probe, .detach_client = tuner_detach, .command = tuner_command, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) .driver = { .suspend = tuner_suspend, .resume = tuner_resume, }, +#endif }; static struct i2c_client client_template = { .name = "(tuner unset)", |