summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/max11801_ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/max11801_ts.c')
-rwxr-xr-xdrivers/input/touchscreen/max11801_ts.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c
index 48ee3600a03b..a1ac2d204295 100755
--- a/drivers/input/touchscreen/max11801_ts.c
+++ b/drivers/input/touchscreen/max11801_ts.c
@@ -106,6 +106,7 @@ struct max11801_data {
};
struct i2c_client *max11801_client;
unsigned int max11801_workmode;
+u8 aux_buf[AUX_BUFSIZE];
static int max11801_dcm_write_command(struct i2c_client *client, int command)
{
@@ -115,7 +116,6 @@ static int max11801_dcm_write_command(struct i2c_client *client, int command)
static u32 max11801_dcm_sample_aux(struct i2c_client *client)
{
u8 temp_buf;
- u8 aux_buf[AUX_BUFSIZE];
int ret;
int aux = 0;
u32 sample_data = 0;
@@ -124,15 +124,17 @@ static u32 max11801_dcm_sample_aux(struct i2c_client *client)
mdelay(5);
ret = i2c_smbus_read_i2c_block_data(client, FIFO_RD_AUX_MSB,
1, &temp_buf);
- aux_buf[0] = temp_buf;
if (ret < 1)
printk(KERN_DEBUG "FIFO_RD_AUX_MSB read fails\n");
+ else
+ aux_buf[0] = temp_buf;
mdelay(5);
ret = i2c_smbus_read_i2c_block_data(client, FIFO_RD_AUX_LSB,
1, &temp_buf);
- aux_buf[1] = temp_buf;
if (ret < 1)
printk(KERN_DEBUG "FIFO_RD_AUX_LSB read fails\n");
+ else
+ aux_buf[1] = temp_buf;
aux = (aux_buf[0] << 4) +
(aux_buf[1] >> 4);
/*