Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318300
b: refs/heads/master
c: cf94bc0
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Kurtz authored and Henrik Rydberg committed Jun 29, 2012
1 parent 725baac commit 3b77db3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9638ab7c9c3b352d54f4f7e80027bd6e1c0584e8
refs/heads/master: cf94bc09c89c923d339c68cf89360c02578ceee3
24 changes: 12 additions & 12 deletions trunk/drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ static int mxt_check_reg_init(struct mxt_data *data)
struct mxt_object *object;
struct device *dev = &data->client->dev;
int index = 0;
int i, j, config_offset;
int i, size;
int ret;

if (!pdata->config) {
dev_dbg(dev, "No cfg data defined, skipping reg init\n");
Expand All @@ -668,18 +669,17 @@ static int mxt_check_reg_init(struct mxt_data *data)
if (!mxt_object_writable(object->type))
continue;

for (j = 0;
j < (object->size + 1) * (object->instances + 1);
j++) {
config_offset = index + j;
if (config_offset > pdata->config_length) {
dev_err(dev, "Not enough config data!\n");
return -EINVAL;
}
mxt_write_object(data, object->type, j,
pdata->config[config_offset]);
size = (object->size + 1) * (object->instances + 1);
if (index + size > pdata->config_length) {
dev_err(dev, "Not enough config data!\n");
return -EINVAL;
}
index += (object->size + 1) * (object->instances + 1);

ret = __mxt_write_reg(data->client, object->start_address,
size, &pdata->config[index]);
if (ret)
return ret;
index += size;
}

return 0;
Expand Down

0 comments on commit 3b77db3

Please sign in to comment.