diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2024-08-21 14:14:55 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2024-09-02 09:45:14 +0200 |
commit | 10a968b21b89c647faa26b1f06ea82aa2eef1f9a (patch) | |
tree | 0359f39c2fa93537e5a34e248a0bf50c709ec8ce | |
parent | gpio: ath79: add missing header (diff) | |
download | linux-10a968b21b89c647faa26b1f06ea82aa2eef1f9a.tar.xz linux-10a968b21b89c647faa26b1f06ea82aa2eef1f9a.zip |
gpio: ath79: use generic device property getters
Don't use specialized OF accessors if we can avoid it: switch to using
the generic device property helpers.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240821121456.19553-3-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-ath79.c | 8 |
1 files 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; |