struct gpio_chip *gc = &info->gpio_chip;
struct irq_chip *irqchip = &info->irq_chip;
struct gpio_irq_chip *girq = &gc->irq;
+ struct device_node *np = to_of_node(gc->fwnode);
struct device *dev = &pdev->dev;
- struct device_node *np;
- int ret = -ENODEV, i, nr_irq_parent;
-
- /* Check if we have at least one gpio-controller child node */
- for_each_child_of_node(dev->of_node, np) {
- if (of_property_read_bool(np, "gpio-controller")) {
- ret = 0;
- break;
- }
- }
- if (ret)
- return dev_err_probe(dev, ret, "no gpio-controller child node\n");
+ unsigned int i, nr_irq_parent;
- nr_irq_parent = of_irq_count(np);
spin_lock_init(&info->irq_lock);
+ nr_irq_parent = of_irq_count(np);
if (!nr_irq_parent) {
dev_err(dev, "invalid or no IRQ\n");
return 0;