From: Bartosz Golaszewski <brgl@bgdev.pl>
To: James Cowgill <james.cowgill@blaize.com>,
Matt Redfearn <matt.redfearn@blaize.com>,
Neil Jones <neil.jones@blaize.com>,
Nikolaos Pasaloukos <nikolaos.pasaloukos@blaize.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH] gpio: blzp1600: drop dependency on OF headers
Date: Tue, 8 Apr 2025 16:36:29 +0200 [thread overview]
Message-ID: <20250408143629.125576-1-brgl@bgdev.pl> (raw)
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
next reply other threads:[~2025-04-08 14:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 14:36 Bartosz Golaszewski [this message]
2025-04-09 8:58 ` Nikolaos Pasaloukos
2025-04-16 15:56 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250408143629.125576-1-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=bartosz.golaszewski@linaro.org \
--cc=james.cowgill@blaize.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt.redfearn@blaize.com \
--cc=neil.jones@blaize.com \
--cc=nikolaos.pasaloukos@blaize.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®