Input: hideep - switch to use device_property_count_u32()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 12 Aug 2019 07:00:16 +0000 (00:00 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 12 Aug 2019 07:03:11 +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/touchscreen/hideep.c

index 84fbbf4..ddad4a8 100644 (file)
@@ -811,8 +811,7 @@ static int hideep_init_input(struct hideep_ts *ts)
        if (error)
                return error;
 
-       ts->key_num = device_property_read_u32_array(dev, "linux,keycodes",
-                                                    NULL, 0);
+       ts->key_num = device_property_count_u32(dev, "linux,keycodes");
        if (ts->key_num > HIDEEP_KEY_MAX) {
                dev_err(dev, "too many keys defined: %d\n",
                        ts->key_num);