]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Input: matrix_keypad - replace of_gpio_named_count() by gpiod_count()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 30 Aug 2022 21:15:18 +0000 (14:15 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 30 Aug 2022 21:20:01 +0000 (14:20 -0700)
As a preparation to unexport of_gpio_named_count(), convert the
driver to use gpiod_count() instead.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220830183552.50695-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/matrix_keypad.c

index 30924b57058f251501f8dec1472bd33f5e88131a..63f078f2bc4aecac53cb9c88bb113ae75d26461a 100644 (file)
@@ -416,9 +416,9 @@ matrix_keypad_parse_dt(struct device *dev)
                return ERR_PTR(-ENOMEM);
        }
 
-       pdata->num_row_gpios = nrow = of_gpio_named_count(np, "row-gpios");
-       pdata->num_col_gpios = ncol = of_gpio_named_count(np, "col-gpios");
-       if (nrow <= 0 || ncol <= 0) {
+       pdata->num_row_gpios = nrow = gpiod_count(dev, "row");
+       pdata->num_col_gpios = ncol = gpiod_count(dev, "col");
+       if (nrow < 0 || ncol < 0) {
                dev_err(dev, "number of keypad rows/columns not specified\n");
                return ERR_PTR(-EINVAL);
        }