diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-08-25 11:48:46 +0200 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-08-25 12:05:38 +0200 |
| commit | 8a8e9a1a9272f262699960ca2782de87ea69dd32 (patch) | |
| tree | de8177ffe0c5f25a39e230c0d3a10883fc81e863 /drivers/gpio | |
| parent | d6307707d50b468d614a80daf60ead8b7036f156 (diff) | |
| download | net-8a8e9a1a9272f262699960ca2782de87ea69dd32.tar.gz | |
gpio: ts4800: use generic device properties
Avoid pulling in linux/of.h by using the generic device properties.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250825-gpio-mmio-gpio-conv-v1-5-356b4b1d5110@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio')
| -rw-r--r-- | drivers/gpio/gpio-ts4800.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-ts4800.c b/drivers/gpio/gpio-ts4800.c index 86f7947ca9b2d2..f4ae87325393c9 100644 --- a/drivers/gpio/gpio-ts4800.c +++ b/drivers/gpio/gpio-ts4800.c @@ -7,8 +7,8 @@ #include <linux/gpio/driver.h> #include <linux/module.h> -#include <linux/of.h> #include <linux/platform_device.h> +#include <linux/property.h> #define DEFAULT_PIN_NUMBER 16 #define INPUT_REG_OFFSET 0x00 @@ -17,7 +17,7 @@ static int ts4800_gpio_probe(struct platform_device *pdev) { - struct device_node *node; + struct device *dev = &pdev->dev; struct gpio_chip *chip; void __iomem *base_addr; int retval; @@ -31,11 +31,7 @@ static int ts4800_gpio_probe(struct platform_device *pdev) if (IS_ERR(base_addr)) return PTR_ERR(base_addr); - node = pdev->dev.of_node; - if (!node) - return -EINVAL; - - retval = of_property_read_u32(node, "ngpios", &ngpios); + retval = device_property_read_u32(dev, "ngpios", &ngpios); if (retval == -EINVAL) ngpios = DEFAULT_PIN_NUMBER; else if (retval) |
