From 8a8e9a1a9272f262699960ca2782de87ea69dd32 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Mon, 25 Aug 2025 11:48:46 +0200 Subject: [PATCH] gpio: ts4800: use generic device properties Avoid pulling in linux/of.h by using the generic device properties. Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20250825-gpio-mmio-gpio-conv-v1-5-356b4b1d5110@linaro.org Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-ts4800.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpio/gpio-ts4800.c b/drivers/gpio/gpio-ts4800.c index 86f7947ca9b2d..f4ae87325393c 100644 --- a/drivers/gpio/gpio-ts4800.c +++ b/drivers/gpio/gpio-ts4800.c @@ -7,8 +7,8 @@ #include #include -#include #include +#include #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) -- 2.47.3