summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-04-01 13:36:03 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-04-18 16:18:40 +0300
commit2954ce1e452567c17e3899be2df6b145bc50a05e (patch)
treef9379edd3153d0324a82e5bb4c69c93f8f7c7c15
parentaf47d8033fc731f19600efd27ba4a7d0fdfcc77c (diff)
pinctrl: armada-37xx: Switch to use fwnode instead of of_node
GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-armada-37xx.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
index 08cad14042e2..110f70bce3fe 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -21,6 +21,7 @@
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/string_helpers.h>
@@ -787,18 +788,13 @@ static int armada_37xx_gpiochip_register(struct platform_device *pdev,
struct armada_37xx_pinctrl *info)
{
struct device *dev = &pdev->dev;
- struct device_node *np;
+ struct fwnode_handle *fwnode;
struct gpio_chip *gc;
- int ret = -ENODEV;
+ int ret;
- for_each_child_of_node(dev->of_node, np) {
- if (of_find_property(np, "gpio-controller", NULL)) {
- ret = 0;
- break;
- }
- }
- if (ret)
- return ret;
+ fwnode = gpiochip_node_get_first(dev);
+ if (!fwnode)
+ return -ENODEV;
info->gpio_chip = armada_37xx_gpiolib_chip;
@@ -806,7 +802,7 @@ static int armada_37xx_gpiochip_register(struct platform_device *pdev,
gc->ngpio = info->data->nr_pins;
gc->parent = dev;
gc->base = -1;
- gc->of_node = np;
+ gc->fwnode = fwnode;
gc->label = info->data->name;
ret = armada_37xx_irqchip_register(pdev, info);