aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/msp3400-driver.c')
-rw-r--r--drivers/media/video/msp3400-driver.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index 2fb9fe6a1ae7..ba1af3c8525e 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -780,18 +780,16 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
780 return 0; 780 return 0;
781} 781}
782 782
783static int msp_suspend(struct device * dev, pm_message_t state) 783static int msp_suspend(struct i2c_client *client, pm_message_t state)
784{ 784{
785 struct i2c_client *client = container_of(dev, struct i2c_client, dev);
786 785
787 v4l_dbg(1, msp_debug, client, "suspend\n"); 786 v4l_dbg(1, msp_debug, client, "suspend\n");
788 msp_reset(client); 787 msp_reset(client);
789 return 0; 788 return 0;
790} 789}
791 790
792static int msp_resume(struct device * dev) 791static int msp_resume(struct i2c_client *client)
793{ 792{
794 struct i2c_client *client = container_of(dev, struct i2c_client, dev);
795 793
796 v4l_dbg(1, msp_debug, client, "resume\n"); 794 v4l_dbg(1, msp_debug, client, "resume\n");
797 msp_wake_thread(client); 795 msp_wake_thread(client);
@@ -825,7 +823,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
825 if (msp_reset(client) == -1) { 823 if (msp_reset(client) == -1) {
826 v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); 824 v4l_dbg(1, msp_debug, client, "msp3400 not found\n");
827 kfree(client); 825 kfree(client);
828 return -1; 826 return 0;
829 } 827 }
830 828
831 state = kmalloc(sizeof(*state), GFP_KERNEL); 829 state = kmalloc(sizeof(*state), GFP_KERNEL);
@@ -859,7 +857,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
859 v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n"); 857 v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n");
860 kfree(state); 858 kfree(state);
861 kfree(client); 859 kfree(client);
862 return -1; 860 return 0;
863 } 861 }
864 862
865 msp_set_audio(client); 863 msp_set_audio(client);
@@ -996,11 +994,11 @@ static struct i2c_driver i2c_driver = {
996 .id = I2C_DRIVERID_MSP3400, 994 .id = I2C_DRIVERID_MSP3400,
997 .attach_adapter = msp_probe, 995 .attach_adapter = msp_probe,
998 .detach_client = msp_detach, 996 .detach_client = msp_detach,
997 .suspend = msp_suspend,
998 .resume = msp_resume,
999 .command = msp_command, 999 .command = msp_command,
1000 .driver = { 1000 .driver = {
1001 .name = "msp3400", 1001 .name = "msp3400",
1002 .suspend = msp_suspend,
1003 .resume = msp_resume,
1004 }, 1002 },
1005}; 1003};
1006 1004