Commit 2954ce1e authored by Andy Shevchenko's avatar Andy Shevchenko

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent af47d803
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/pinctrl/pinctrl.h> #include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h> #include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string_helpers.h> #include <linux/string_helpers.h>
...@@ -787,18 +788,13 @@ static int armada_37xx_gpiochip_register(struct platform_device *pdev, ...@@ -787,18 +788,13 @@ static int armada_37xx_gpiochip_register(struct platform_device *pdev,
struct armada_37xx_pinctrl *info) struct armada_37xx_pinctrl *info)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *np; struct fwnode_handle *fwnode;
struct gpio_chip *gc; struct gpio_chip *gc;
int ret = -ENODEV; int ret;
for_each_child_of_node(dev->of_node, np) { fwnode = gpiochip_node_get_first(dev);
if (of_find_property(np, "gpio-controller", NULL)) { if (!fwnode)
ret = 0; return -ENODEV;
break;
}
}
if (ret)
return ret;
info->gpio_chip = armada_37xx_gpiolib_chip; info->gpio_chip = armada_37xx_gpiolib_chip;
...@@ -806,7 +802,7 @@ static int armada_37xx_gpiochip_register(struct platform_device *pdev, ...@@ -806,7 +802,7 @@ static int armada_37xx_gpiochip_register(struct platform_device *pdev,
gc->ngpio = info->data->nr_pins; gc->ngpio = info->data->nr_pins;
gc->parent = dev; gc->parent = dev;
gc->base = -1; gc->base = -1;
gc->of_node = np; gc->fwnode = fwnode;
gc->label = info->data->name; gc->label = info->data->name;
ret = armada_37xx_irqchip_register(pdev, info); ret = armada_37xx_irqchip_register(pdev, info);
......
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