Commit 6e57ce76 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Dmitry Torokhov

Input: mpr121 - switch to use device_property_count_u32()

Use use device_property_count_u32() directly, that makes code neater.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent d99995a4
...@@ -253,8 +253,7 @@ static int mpr_touchkey_probe(struct i2c_client *client, ...@@ -253,8 +253,7 @@ static int mpr_touchkey_probe(struct i2c_client *client,
mpr121->client = client; mpr121->client = client;
mpr121->input_dev = input_dev; mpr121->input_dev = input_dev;
mpr121->keycount = device_property_read_u32_array(dev, "linux,keycodes", mpr121->keycount = device_property_count_u32(dev, "linux,keycodes");
NULL, 0);
if (mpr121->keycount > MPR121_MAX_KEY_COUNT) { if (mpr121->keycount > MPR121_MAX_KEY_COUNT) {
dev_err(dev, "too many keys defined (%d)\n", mpr121->keycount); dev_err(dev, "too many keys defined (%d)\n", mpr121->keycount);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment