public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Alban Bedel <albeu@free.fr>, Linus Walleij <linus.walleij@linaro.org>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 3/4] gpio: ath79: use generic device property getters
Date: Wed, 21 Aug 2024 14:14:55 +0200	[thread overview]
Message-ID: <20240821121456.19553-3-brgl@bgdev.pl> (raw)
In-Reply-To: <20240821121456.19553-1-brgl@bgdev.pl>

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Don't use specialized OF accessors if we can avoid it: switch to using
the generic device property helpers.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpio-ath79.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index 7f9e66d75c8b..211faffbef32 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -8,12 +8,12 @@
  *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
  */
 
+#include <linux/device.h>
 #include <linux/gpio/driver.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of.h>
 #include <linux/platform_data/gpio-ath79.h>
 #include <linux/platform_device.h>
 
@@ -239,12 +239,12 @@ static int ath79_gpio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	if (np) {
-		err = of_property_read_u32(np, "ngpios", &ath79_gpio_count);
+		err = device_property_read_u32(dev, "ngpios", &ath79_gpio_count);
 		if (err) {
 			dev_err(dev, "ngpios property is not valid\n");
 			return err;
 		}
-		oe_inverted = of_device_is_compatible(np, "qca,ar9340-gpio");
+		oe_inverted = device_is_compatible(dev, "qca,ar9340-gpio");
 	} else if (pdata) {
 		ath79_gpio_count = pdata->ngpios;
 		oe_inverted = pdata->oe_inverted;
@@ -276,7 +276,7 @@ static int ath79_gpio_probe(struct platform_device *pdev)
 	}
 
 	/* Optional interrupt setup */
-	if (!np || of_property_read_bool(np, "interrupt-controller")) {
+	if (device_property_read_bool(dev, "interrupt-controller")) {
 		girq = &ctrl->gc.irq;
 		gpio_irq_chip_set_chip(girq, &ath79_gpio_irqchip);
 		girq->parent_handler = ath79_gpio_irq_handler;
-- 
2.43.0


  parent reply	other threads:[~2024-08-21 12:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 12:14 [PATCH 1/4] gpio: ath79: order headers alphabetically Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 2/4] gpio: ath79: add missing header Bartosz Golaszewski
2024-08-21 12:14 ` Bartosz Golaszewski [this message]
2024-08-21 12:14 ` [PATCH 4/4] gpio: ath79: remove support for platform data Bartosz Golaszewski
2024-08-26  8:23 ` [PATCH 1/4] gpio: ath79: order headers alphabetically Linus Walleij
2024-09-02  9:10 ` 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=20240821121456.19553-3-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --cc=albeu@free.fr \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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