diff options
Diffstat (limited to 'drivers/input/touchscreen/qt602240_ts.c')
-rw-r--r-- | drivers/input/touchscreen/qt602240_ts.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/input/touchscreen/qt602240_ts.c b/drivers/input/touchscreen/qt602240_ts.c index 66b26ad3032a..4dcb0e872f6a 100644 --- a/drivers/input/touchscreen/qt602240_ts.c +++ b/drivers/input/touchscreen/qt602240_ts.c | |||
@@ -969,7 +969,7 @@ static int qt602240_initialize(struct qt602240_data *data) | |||
969 | return error; | 969 | return error; |
970 | 970 | ||
971 | data->object_table = kcalloc(info->object_num, | 971 | data->object_table = kcalloc(info->object_num, |
972 | sizeof(struct qt602240_data), | 972 | sizeof(struct qt602240_object), |
973 | GFP_KERNEL); | 973 | GFP_KERNEL); |
974 | if (!data->object_table) { | 974 | if (!data->object_table) { |
975 | dev_err(&client->dev, "Failed to allocate memory\n"); | 975 | dev_err(&client->dev, "Failed to allocate memory\n"); |
@@ -1324,8 +1324,9 @@ static int __devexit qt602240_remove(struct i2c_client *client) | |||
1324 | } | 1324 | } |
1325 | 1325 | ||
1326 | #ifdef CONFIG_PM | 1326 | #ifdef CONFIG_PM |
1327 | static int qt602240_suspend(struct i2c_client *client, pm_message_t mesg) | 1327 | static int qt602240_suspend(struct device *dev) |
1328 | { | 1328 | { |
1329 | struct i2c_client *client = to_i2c_client(dev); | ||
1329 | struct qt602240_data *data = i2c_get_clientdata(client); | 1330 | struct qt602240_data *data = i2c_get_clientdata(client); |
1330 | struct input_dev *input_dev = data->input_dev; | 1331 | struct input_dev *input_dev = data->input_dev; |
1331 | 1332 | ||
@@ -1339,8 +1340,9 @@ static int qt602240_suspend(struct i2c_client *client, pm_message_t mesg) | |||
1339 | return 0; | 1340 | return 0; |
1340 | } | 1341 | } |
1341 | 1342 | ||
1342 | static int qt602240_resume(struct i2c_client *client) | 1343 | static int qt602240_resume(struct device *dev) |
1343 | { | 1344 | { |
1345 | struct i2c_client *client = to_i2c_client(dev); | ||
1344 | struct qt602240_data *data = i2c_get_clientdata(client); | 1346 | struct qt602240_data *data = i2c_get_clientdata(client); |
1345 | struct input_dev *input_dev = data->input_dev; | 1347 | struct input_dev *input_dev = data->input_dev; |
1346 | 1348 | ||
@@ -1359,9 +1361,11 @@ static int qt602240_resume(struct i2c_client *client) | |||
1359 | 1361 | ||
1360 | return 0; | 1362 | return 0; |
1361 | } | 1363 | } |
1362 | #else | 1364 | |
1363 | #define qt602240_suspend NULL | 1365 | static const struct dev_pm_ops qt602240_pm_ops = { |
1364 | #define qt602240_resume NULL | 1366 | .suspend = qt602240_suspend, |
1367 | .resume = qt602240_resume, | ||
1368 | }; | ||
1365 | #endif | 1369 | #endif |
1366 | 1370 | ||
1367 | static const struct i2c_device_id qt602240_id[] = { | 1371 | static const struct i2c_device_id qt602240_id[] = { |
@@ -1374,11 +1378,12 @@ static struct i2c_driver qt602240_driver = { | |||
1374 | .driver = { | 1378 | .driver = { |
1375 | .name = "qt602240_ts", | 1379 | .name = "qt602240_ts", |
1376 | .owner = THIS_MODULE, | 1380 | .owner = THIS_MODULE, |
1381 | #ifdef CONFIG_PM | ||
1382 | .pm = &qt602240_pm_ops, | ||
1383 | #endif | ||
1377 | }, | 1384 | }, |
1378 | .probe = qt602240_probe, | 1385 | .probe = qt602240_probe, |
1379 | .remove = __devexit_p(qt602240_remove), | 1386 | .remove = __devexit_p(qt602240_remove), |
1380 | .suspend = qt602240_suspend, | ||
1381 | .resume = qt602240_resume, | ||
1382 | .id_table = qt602240_id, | 1387 | .id_table = qt602240_id, |
1383 | }; | 1388 | }; |
1384 | 1389 | ||