mirror of https://gitee.com/openkylin/linux.git
Input: mpr121 - switch to use device_property_count_u32()
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>
This commit is contained in:
parent
d99995a4f0
commit
6e57ce76d0
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue