* [PATCH v1 1/1] gpio: ixp4xx: Replace of_node_to_fwnode() with more suitable API
@ 2024-08-22 22:33 Andy Shevchenko
2024-08-26 8:43 ` Linus Walleij
2024-09-02 10:24 ` Bartosz Golaszewski
0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2024-08-22 22:33 UTC (permalink / raw)
To: Andy Shevchenko, Linus Walleij, linux-arm-kernel, linux-gpio,
linux-kernel
Cc: Linus Walleij, Imre Kaloz, Bartosz Golaszewski
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>
---
drivers/gpio/gpio-ixp4xx.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-ixp4xx.c b/drivers/gpio/gpio-ixp4xx.c
index c5a9fa640566..28a8a6a8f05f 100644
--- a/drivers/gpio/gpio-ixp4xx.c
+++ b/drivers/gpio/gpio-ixp4xx.c
@@ -6,6 +6,7 @@
// based on previous work and know-how from:
// Deepak Saxena <dsaxena@plexity.net>
+#include <linux/bitops.h>
#include <linux/gpio/driver.h>
#include <linux/io.h>
#include <linux/irq.h>
@@ -13,7 +14,7 @@
#include <linux/irqchip.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
-#include <linux/bitops.h>
+#include <linux/property.h>
#define IXP4XX_REG_GPOUT 0x00
#define IXP4XX_REG_GPOE 0x04
@@ -53,16 +54,14 @@
/**
* struct ixp4xx_gpio - IXP4 GPIO state container
* @dev: containing device for this instance
- * @fwnode: the fwnode for this GPIO chip
* @gc: gpiochip for this instance
* @base: remapped I/O-memory base
* @irq_edge: Each bit represents an IRQ: 1: edge-triggered,
* 0: level triggered
*/
struct ixp4xx_gpio {
- struct device *dev;
- struct fwnode_handle *fwnode;
struct gpio_chip gc;
+ struct device *dev;
void __iomem *base;
unsigned long long irq_edge;
};
@@ -237,7 +236,6 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
dev_err(dev, "no IRQ parent domain\n");
return -ENODEV;
}
- g->fwnode = of_node_to_fwnode(np);
/*
* If either clock output is enabled explicitly in the device tree
@@ -322,7 +320,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
girq = &g->gc.irq;
gpio_irq_chip_set_chip(girq, &ixp4xx_gpio_irqchip);
- girq->fwnode = g->fwnode;
+ girq->fwnode = dev_fwnode(dev);
girq->parent_domain = parent;
girq->child_to_parent_hwirq = ixp4xx_gpio_child_to_parent_hwirq;
girq->handler = handle_bad_irq;
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] gpio: ixp4xx: Replace of_node_to_fwnode() with more suitable API
2024-08-22 22:33 [PATCH v1 1/1] gpio: ixp4xx: Replace of_node_to_fwnode() with more suitable API Andy Shevchenko
@ 2024-08-26 8:43 ` Linus Walleij
2024-09-02 10:24 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2024-08-26 8:43 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-arm-kernel, linux-gpio, linux-kernel, Linus Walleij,
Imre Kaloz, Bartosz Golaszewski
On Fri, Aug 23, 2024 at 12:33 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> 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>
Neat, nice with the small cleanup as well.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] gpio: ixp4xx: Replace of_node_to_fwnode() with more suitable API
2024-08-22 22:33 [PATCH v1 1/1] gpio: ixp4xx: Replace of_node_to_fwnode() with more suitable API Andy Shevchenko
2024-08-26 8:43 ` Linus Walleij
@ 2024-09-02 10:24 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2024-09-02 10:24 UTC (permalink / raw)
To: Linus Walleij, linux-arm-kernel, linux-gpio, linux-kernel,
Andy Shevchenko
Cc: Bartosz Golaszewski, Linus Walleij, Imre Kaloz,
Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On Fri, 23 Aug 2024 01:33:32 +0300, Andy Shevchenko wrote:
> of_node_to_fwnode() is a IRQ domain specific implementation of
> of_fwnode_handle(). Replace the former with more suitable API.
>
>
Applied, thanks!
[1/1] gpio: ixp4xx: Replace of_node_to_fwnode() with more suitable API
commit: 24127ba3b4a16e0aebab248ca9513a15d323e6af
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-02 10:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22 22:33 [PATCH v1 1/1] gpio: ixp4xx: Replace of_node_to_fwnode() with more suitable API Andy Shevchenko
2024-08-26 8:43 ` Linus Walleij
2024-09-02 10:24 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).