aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/qt2160.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/keyboard/qt2160.c')
-rw-r--r--drivers/input/keyboard/qt2160.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index 76b7d430d03..3dc2b0f27b0 100644
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -183,7 +183,7 @@ static void qt2160_worker(struct work_struct *work)
183 qt2160_schedule_read(qt2160); 183 qt2160_schedule_read(qt2160);
184} 184}
185 185
186static int __devinit qt2160_read(struct i2c_client *client, u8 reg) 186static int qt2160_read(struct i2c_client *client, u8 reg)
187{ 187{
188 int ret; 188 int ret;
189 189
@@ -204,29 +204,20 @@ static int __devinit qt2160_read(struct i2c_client *client, u8 reg)
204 return ret; 204 return ret;
205} 205}
206 206
207static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data) 207static int qt2160_write(struct i2c_client *client, u8 reg, u8 data)
208{ 208{
209 int error; 209 int ret;
210
211 error = i2c_smbus_write_byte(client, reg);
212 if (error) {
213 dev_err(&client->dev,
214 "couldn't send request. Returned %d\n", error);
215 return error;
216 }
217 210
218 error = i2c_smbus_write_byte(client, data); 211 ret = i2c_smbus_write_byte_data(client, reg, data);
219 if (error) { 212 if (ret < 0)
220 dev_err(&client->dev, 213 dev_err(&client->dev,
221 "couldn't write data. Returned %d\n", error); 214 "couldn't write data. Returned %d\n", ret);
222 return error;
223 }
224 215
225 return error; 216 return ret;
226} 217}
227 218
228 219
229static bool __devinit qt2160_identify(struct i2c_client *client) 220static bool qt2160_identify(struct i2c_client *client)
230{ 221{
231 int id, ver, rev; 222 int id, ver, rev;
232 223
@@ -257,7 +248,7 @@ static bool __devinit qt2160_identify(struct i2c_client *client)
257 return true; 248 return true;
258} 249}
259 250
260static int __devinit qt2160_probe(struct i2c_client *client, 251static int qt2160_probe(struct i2c_client *client,
261 const struct i2c_device_id *id) 252 const struct i2c_device_id *id)
262{ 253{
263 struct qt2160_data *qt2160; 254 struct qt2160_data *qt2160;
@@ -344,7 +335,7 @@ err_free_mem:
344 return error; 335 return error;
345} 336}
346 337
347static int __devexit qt2160_remove(struct i2c_client *client) 338static int qt2160_remove(struct i2c_client *client)
348{ 339{
349 struct qt2160_data *qt2160 = i2c_get_clientdata(client); 340 struct qt2160_data *qt2160 = i2c_get_clientdata(client);
350 341
@@ -375,7 +366,7 @@ static struct i2c_driver qt2160_driver = {
375 366
376 .id_table = qt2160_idtable, 367 .id_table = qt2160_idtable,
377 .probe = qt2160_probe, 368 .probe = qt2160_probe,
378 .remove = __devexit_p(qt2160_remove), 369 .remove = qt2160_remove,
379}; 370};
380 371
381module_i2c_driver(qt2160_driver); 372module_i2c_driver(qt2160_driver);