Skip to content

Commit 1e3d42f

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
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: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20240822223332.705560-1-andy.shevchenko@gmail.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 35ea262 commit 1e3d42f

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

drivers/gpio/gpio-ixp4xx.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
// based on previous work and know-how from:
77
// Deepak Saxena <dsaxena@plexity.net>
88

9+
#include <linux/bitops.h>
910
#include <linux/gpio/driver.h>
1011
#include <linux/io.h>
1112
#include <linux/irq.h>
1213
#include <linux/irqdomain.h>
1314
#include <linux/irqchip.h>
1415
#include <linux/of_irq.h>
1516
#include <linux/platform_device.h>
16-
#include <linux/bitops.h>
17+
#include <linux/property.h>
1718

1819
#define IXP4XX_REG_GPOUT 0x00
1920
#define IXP4XX_REG_GPOE 0x04
@@ -53,16 +54,14 @@
5354
/**
5455
* struct ixp4xx_gpio - IXP4 GPIO state container
5556
* @dev: containing device for this instance
56-
* @fwnode: the fwnode for this GPIO chip
5757
* @gc: gpiochip for this instance
5858
* @base: remapped I/O-memory base
5959
* @irq_edge: Each bit represents an IRQ: 1: edge-triggered,
6060
* 0: level triggered
6161
*/
6262
struct ixp4xx_gpio {
63-
struct device *dev;
64-
struct fwnode_handle *fwnode;
6563
struct gpio_chip gc;
64+
struct device *dev;
6665
void __iomem *base;
6766
unsigned long long irq_edge;
6867
};
@@ -237,7 +236,6 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
237236
dev_err(dev, "no IRQ parent domain\n");
238237
return -ENODEV;
239238
}
240-
g->fwnode = of_node_to_fwnode(np);
241239

242240
/*
243241
* If either clock output is enabled explicitly in the device tree
@@ -322,7 +320,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
322320

323321
girq = &g->gc.irq;
324322
gpio_irq_chip_set_chip(girq, &ixp4xx_gpio_irqchip);
325-
girq->fwnode = g->fwnode;
323+
girq->fwnode = dev_fwnode(dev);
326324
girq->parent_domain = parent;
327325
girq->child_to_parent_hwirq = ixp4xx_gpio_child_to_parent_hwirq;
328326
girq->handler = handle_bad_irq;

0 commit comments

Comments
 (0)