Input: mpr121 - switch to use device_property_count_u32()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 12 Aug 2019 06:59:51 +0000 (23:59 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 12 Aug 2019 07:03:10 +0000 (00:03 -0700)
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>
drivers/input/keyboard/mpr121_touchkey.c

index e9ceaa1..ee80de4 100644 (file)
@@ -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;