* [PATCH] gpio: blzp1600: drop dependency on OF headers
@ 2025-04-08 14:36 Bartosz Golaszewski
2025-04-09 8:58 ` Nikolaos Pasaloukos
2025-04-16 15:56 ` Bartosz Golaszewski
0 siblings, 2 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2025-04-08 14:36 UTC (permalink / raw)
To: James Cowgill, Matt Redfearn, Neil Jones, Nikolaos Pasaloukos,
Linus Walleij
Cc: linux-gpio, linux-kernel, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Use the generic boolean device property getter instead of the
OF-specific variant. This allows us to stop pulling in linux/of.h. While
at it: drop the of_irq.h inclusion as none of its symbols are used in
this driver.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-blzp1600.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-blzp1600.c b/drivers/gpio/gpio-blzp1600.c
index 77ad0e596f3e..2760a13c0801 100644
--- a/drivers/gpio/gpio-blzp1600.c
+++ b/drivers/gpio/gpio-blzp1600.c
@@ -10,9 +10,8 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_irq.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -217,7 +216,6 @@ static int blzp1600_gpio_set_config(struct gpio_chip *gc, unsigned int offset, u
static int blzp1600_gpio_probe(struct platform_device *pdev)
{
- struct device_node *node = pdev->dev.of_node;
struct blzp1600_gpio *chip;
struct gpio_chip *gc;
int ret;
@@ -240,7 +238,7 @@ static int blzp1600_gpio_probe(struct platform_device *pdev)
gc = &chip->gc;
gc->set_config = blzp1600_gpio_set_config;
- if (of_property_read_bool(node, "interrupt-controller")) {
+ if (device_property_present(&pdev->dev, "interrupt-controller")) {
struct gpio_irq_chip *girq;
chip->irq = platform_get_irq(pdev, 0);
--
2.45.2
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] gpio: blzp1600: drop dependency on OF headers
2025-04-08 14:36 [PATCH] gpio: blzp1600: drop dependency on OF headers Bartosz Golaszewski
@ 2025-04-09 8:58 ` Nikolaos Pasaloukos
2025-04-16 15:56 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Nikolaos Pasaloukos @ 2025-04-09 8:58 UTC (permalink / raw)
To: Bartosz Golaszewski, James Cowgill, Matt Redfearn, Neil Jones,
Linus Walleij
Cc: linux-gpio, linux-kernel, Bartosz Golaszewski
On 08/04/2025 15:36, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> Use the generic boolean device property getter instead of the
> OF-specific variant. This allows us to stop pulling in linux/of.h. While
> at it: drop the of_irq.h inclusion as none of its symbols are used in
> this driver.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> drivers/gpio/gpio-blzp1600.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-blzp1600.c b/drivers/gpio/gpio-blzp1600.c
> index 77ad0e596f3e..2760a13c0801 100644
> --- a/drivers/gpio/gpio-blzp1600.c
> +++ b/drivers/gpio/gpio-blzp1600.c
> @@ -10,9 +10,8 @@
> #include <linux/interrupt.h>
> #include <linux/io.h>
> #include <linux/module.h>
> -#include <linux/of.h>
> -#include <linux/of_irq.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/slab.h>
> #include <linux/spinlock.h>
>
> @@ -217,7 +216,6 @@ static int blzp1600_gpio_set_config(struct gpio_chip *gc, unsigned int offset, u
>
> static int blzp1600_gpio_probe(struct platform_device *pdev)
> {
> - struct device_node *node = pdev->dev.of_node;
> struct blzp1600_gpio *chip;
> struct gpio_chip *gc;
> int ret;
> @@ -240,7 +238,7 @@ static int blzp1600_gpio_probe(struct platform_device *pdev)
> gc = &chip->gc;
> gc->set_config = blzp1600_gpio_set_config;
>
> - if (of_property_read_bool(node, "interrupt-controller")) {
> + if (device_property_present(&pdev->dev, "interrupt-controller")) {
> struct gpio_irq_chip *girq;
>
> chip->irq = platform_get_irq(pdev, 0);
Reviewed-by: Nikolaos Pasaloukos <nikolaos.pasaloukos@blaize.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] gpio: blzp1600: drop dependency on OF headers
2025-04-08 14:36 [PATCH] gpio: blzp1600: drop dependency on OF headers Bartosz Golaszewski
2025-04-09 8:58 ` Nikolaos Pasaloukos
@ 2025-04-16 15:56 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2025-04-16 15:56 UTC (permalink / raw)
To: James Cowgill, Matt Redfearn, Neil Jones, Nikolaos Pasaloukos,
Linus Walleij, Bartosz Golaszewski
Cc: linux-gpio, linux-kernel, Bartosz Golaszewski
On Tue, 08 Apr 2025 16:36:29 +0200, Bartosz Golaszewski wrote:
> Use the generic boolean device property getter instead of the
> OF-specific variant. This allows us to stop pulling in linux/of.h. While
> at it: drop the of_irq.h inclusion as none of its symbols are used in
> this driver.
>
>
Applied, thanks!
[1/1] gpio: blzp1600: drop dependency on OF headers
https://git.kernel.org/brgl/linux/c/01aecc78d9eaae7c8a7c3183edf47a0aac52ab5c
Best regards,
--
Bartosz Golaszewski <brgl@bgdev.pl>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-16 15:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-08 14:36 [PATCH] gpio: blzp1600: drop dependency on OF headers Bartosz Golaszewski
2025-04-09 8:58 ` Nikolaos Pasaloukos
2025-04-16 15:56 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®