summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/msp3400-driver.c
diff options
context:
space:
mode:
authorHans Verkuil <devnull@localhost>2005-11-27 00:31:22 +0000
committerHans Verkuil <devnull@localhost>2005-11-27 00:31:22 +0000
commitb378c9b9b9480ef6352bc5f37e30369dda75625e (patch)
tree1c54fb20bc99627ed4ab57d1456aaa5818ceed1b /linux/drivers/media/video/msp3400-driver.c
parentecc615b56853187aabee05db0948691dec891f45 (diff)
downloadmediapointer-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/video/msp3400-driver.c')
-rw-r--r--linux/drivers/media/video/msp3400-driver.c107
1 files changed, 46 insertions, 61 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);