Commit 1e3d42f5 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski

gpio: ixp4xx: Replace of_node_to_fwnode() with more suitable API

of_node_to_fwnode() is a IRQ domain specific implementation of
of_fwnode_handle(). Replace the former with more suitable API.
Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240822223332.705560-1-andy.shevchenko@gmail.comSigned-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 35ea2624
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// based on previous work and know-how from: // based on previous work and know-how from:
// Deepak Saxena <dsaxena@plexity.net> // Deepak Saxena <dsaxena@plexity.net>
#include <linux/bitops.h>
#include <linux/gpio/driver.h> #include <linux/gpio/driver.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/irq.h> #include <linux/irq.h>
...@@ -13,7 +14,7 @@ ...@@ -13,7 +14,7 @@
#include <linux/irqchip.h> #include <linux/irqchip.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/bitops.h> #include <linux/property.h>
#define IXP4XX_REG_GPOUT 0x00 #define IXP4XX_REG_GPOUT 0x00
#define IXP4XX_REG_GPOE 0x04 #define IXP4XX_REG_GPOE 0x04
...@@ -53,16 +54,14 @@ ...@@ -53,16 +54,14 @@
/** /**
* struct ixp4xx_gpio - IXP4 GPIO state container * struct ixp4xx_gpio - IXP4 GPIO state container
* @dev: containing device for this instance * @dev: containing device for this instance
* @fwnode: the fwnode for this GPIO chip
* @gc: gpiochip for this instance * @gc: gpiochip for this instance
* @base: remapped I/O-memory base * @base: remapped I/O-memory base
* @irq_edge: Each bit represents an IRQ: 1: edge-triggered, * @irq_edge: Each bit represents an IRQ: 1: edge-triggered,
* 0: level triggered * 0: level triggered
*/ */
struct ixp4xx_gpio { struct ixp4xx_gpio {
struct device *dev;
struct fwnode_handle *fwnode;
struct gpio_chip gc; struct gpio_chip gc;
struct device *dev;
void __iomem *base; void __iomem *base;
unsigned long long irq_edge; unsigned long long irq_edge;
}; };
...@@ -237,7 +236,6 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev) ...@@ -237,7 +236,6 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
dev_err(dev, "no IRQ parent domain\n"); dev_err(dev, "no IRQ parent domain\n");
return -ENODEV; return -ENODEV;
} }
g->fwnode = of_node_to_fwnode(np);
/* /*
* If either clock output is enabled explicitly in the device tree * If either clock output is enabled explicitly in the device tree
...@@ -322,7 +320,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev) ...@@ -322,7 +320,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
girq = &g->gc.irq; girq = &g->gc.irq;
gpio_irq_chip_set_chip(girq, &ixp4xx_gpio_irqchip); gpio_irq_chip_set_chip(girq, &ixp4xx_gpio_irqchip);
girq->fwnode = g->fwnode; girq->fwnode = dev_fwnode(dev);
girq->parent_domain = parent; girq->parent_domain = parent;
girq->child_to_parent_hwirq = ixp4xx_gpio_child_to_parent_hwirq; girq->child_to_parent_hwirq = ixp4xx_gpio_child_to_parent_hwirq;
girq->handler = handle_bad_irq; girq->handler = handle_bad_irq;
......
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