Commit f8f7f47d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Dmitry Torokhov

Input: matrix_keypad - replace of_gpio_named_count() by gpiod_count()

As a preparation to unexport of_gpio_named_count(), convert the
driver to use gpiod_count() instead.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220830183552.50695-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent c5872d6a
......@@ -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);
}
......
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