diff mbox

[5/8] qt2160: fix starting of device calibration

Message ID 1289268911-32322-5-git-send-email-jasaw81@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

jooaun Nov. 9, 2010, 2:15 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index 0d662e2..7647849 100755
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -264,27 +264,6 @@  static int __devinit qt2160_read(struct i2c_client *client, u8 reg)
 	return ret;
 }
 
-static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data)
-{
-	int error;
-
-	error = i2c_smbus_write_byte(client, reg);
-	if (error) {
-		dev_err(&client->dev,
-			"couldn't send request. Returned %d\n", error);
-		return error;
-	}
-
-	error = i2c_smbus_write_byte(client, data);
-	if (error) {
-		dev_err(&client->dev,
-			"couldn't write data. Returned %d\n", error);
-		return error;
-	}
-
-	return error;
-}
-
 static int __devinit qt2160_configure_device(struct i2c_client *client,
 					     struct qt2160_data *qt2160)
 {
@@ -489,7 +468,7 @@  static int __devinit qt2160_probe(struct i2c_client *client,
 	}
 
 	/* Calibrate device */
-	error = qt2160_write(client, QT2160_CMD_CALIBRATE, 1);
+	error = i2c_smbus_write_byte_data(client, QT2160_CMD_CALIBRATE, 1);
 	if (error) {
 		dev_err(&client->dev, "failed to calibrate device\n");
 		goto err_free_mem;