Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346971
b: refs/heads/master
c: efce8a4
h: refs/heads/master
i:
  346969: 5510228
  346967: b2f664d
v: v3
  • Loading branch information
Dmitry Torokhov committed Nov 29, 2012
1 parent 77d8c59 commit 63e9c5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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: bf7f5316cbacbcb7d3c337eba36322cab255dec0
refs/heads/master: efce8a412161b0555254bd6ac1dcdfb7886bfd8c
20 changes: 10 additions & 10 deletions trunk/drivers/input/keyboard/tca8418_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ static int tca8418_configure(struct tca8418_keypad *keypad_data,
static int tca8418_keypad_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct device *dev = &client->dev;
const struct tca8418_keypad_platform_data *pdata =
client->dev.platform_data;
struct tca8418_keypad *keypad_data;
Expand All @@ -294,7 +295,7 @@ static int tca8418_keypad_probe(struct i2c_client *client,
/* Copy the platform data */
if (pdata) {
if (!pdata->keymap_data) {
dev_err(&client->dev, "no keymap data defined\n");
dev_err(dev, "no keymap data defined\n");
return -EINVAL;
}
keymap_data = pdata->keymap_data;
Expand All @@ -303,25 +304,25 @@ static int tca8418_keypad_probe(struct i2c_client *client,
rep = pdata->rep;
irq_is_gpio = pdata->irq_is_gpio;
} else {
struct device_node *np = client->dev.of_node;
struct device_node *np = dev->of_node;
of_property_read_u32(np, "keypad,num-rows", &rows);
of_property_read_u32(np, "keypad,num-columns", &cols);
rep = of_property_read_bool(np, "keypad,autorepeat");
}

if (!rows || rows > TCA8418_MAX_ROWS) {
dev_err(&client->dev, "invalid rows\n");
dev_err(dev, "invalid rows\n");
return -EINVAL;
}

if (!cols || cols > TCA8418_MAX_COLS) {
dev_err(&client->dev, "invalid columns\n");
dev_err(dev, "invalid columns\n");
return -EINVAL;
}

/* Check i2c driver capabilities */
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE)) {
dev_err(&client->dev, "%s adapter not supported\n",
dev_err(dev, "%s adapter not supported\n",
dev_driver_string(&client->adapter->dev));
return -ENODEV;
}
Expand Down Expand Up @@ -362,7 +363,7 @@ static int tca8418_keypad_probe(struct i2c_client *client,
error = matrix_keypad_build_keymap(keymap_data, NULL, rows, cols,
keypad_data->keymap, input);
if (error) {
dev_dbg(&client->dev, "Failed to build keymap\n");
dev_dbg(dev, "Failed to build keymap\n");
goto fail2;
}

Expand All @@ -381,16 +382,15 @@ static int tca8418_keypad_probe(struct i2c_client *client,
IRQF_ONESHOT,
client->name, keypad_data);
if (error) {
dev_dbg(&client->dev,
"Unable to claim irq %d; error %d\n",
dev_dbg(dev, "Unable to claim irq %d; error %d\n",
client->irq, error);
goto fail2;
}

error = input_register_device(input);
if (error) {
dev_dbg(&client->dev,
"Unable to register input device, error: %d\n", error);
dev_dbg(dev, "Unable to register input device, error: %d\n",
error);
goto fail3;
}

Expand Down

0 comments on commit 63e9c5d

Please sign in to comment.