Skip to content

Commit

Permalink
Input: mpr121 - switch to use device_property_count_u32()
Browse files Browse the repository at this point in the history
Use use device_property_count_u32() directly, that makes code neater.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Andy Shevchenko authored and Dmitry Torokhov committed Aug 12, 2019
1 parent d99995a commit 6e57ce7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/input/keyboard/mpr121_touchkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ static int mpr_touchkey_probe(struct i2c_client *client,

mpr121->client = client;
mpr121->input_dev = input_dev;
mpr121->keycount = device_property_read_u32_array(dev, "linux,keycodes",
NULL, 0);
mpr121->keycount = device_property_count_u32(dev, "linux,keycodes");
if (mpr121->keycount > MPR121_MAX_KEY_COUNT) {
dev_err(dev, "too many keys defined (%d)\n", mpr121->keycount);
return -EINVAL;
Expand Down

0 comments on commit 6e57ce7

Please sign in to comment.