aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/elan_i2c_i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/elan_i2c_i2c.c')
-rw-r--r--drivers/input/mouse/elan_i2c_i2c.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/input/mouse/elan_i2c_i2c.c b/drivers/input/mouse/elan_i2c_i2c.c
index 029941f861af..6cf0def6d35e 100644
--- a/drivers/input/mouse/elan_i2c_i2c.c
+++ b/drivers/input/mouse/elan_i2c_i2c.c
@@ -117,7 +117,15 @@ static int elan_i2c_write_cmd(struct i2c_client *client, u16 reg, u16 cmd)
117 int ret; 117 int ret;
118 118
119 ret = i2c_transfer(client->adapter, &msg, 1); 119 ret = i2c_transfer(client->adapter, &msg, 1);
120 return ret == 1 ? 0 : (ret < 0 ? ret : -EIO); 120 if (ret != 1) {
121 if (ret >= 0)
122 ret = -EIO;
123 dev_err(&client->dev, "writing cmd (0x%04x) failed: %d\n",
124 reg, ret);
125 return ret;
126 }
127
128 return 0;
121} 129}
122 130
123static int elan_i2c_initialize(struct i2c_client *client) 131static int elan_i2c_initialize(struct i2c_client *client)