@@ -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;