]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: stmpe: Make use of device properties
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 2 Sep 2024 13:30:43 +0000 (16:30 +0300)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 4 Sep 2024 07:02:43 +0000 (09:02 +0200)
Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240902133148.2569486-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-stmpe.c

index 7f2911c478ea150ba8e7cf12b019fc5b00a3cf6e..c1fb06925e0965ae6d2b902f61486018b31e9ed3 100644 (file)
@@ -11,8 +11,8 @@
 #include <linux/slab.h>
 #include <linux/gpio/driver.h>
 #include <linux/interrupt.h>
-#include <linux/of.h>
 #include <linux/mfd/stmpe.h>
+#include <linux/property.h>
 #include <linux/seq_file.h>
 #include <linux/bitops.h>
 
@@ -465,7 +465,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct stmpe *stmpe = dev_get_drvdata(dev->parent);
-       struct device_node *np = dev->of_node;
        struct stmpe_gpio *stmpe_gpio;
        int ret, irq;
 
@@ -489,8 +488,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
        if (IS_ENABLED(CONFIG_DEBUG_FS))
                 stmpe_gpio->chip.dbg_show = stmpe_dbg_show;
 
-       of_property_read_u32(np, "st,norequest-mask",
-                       &stmpe_gpio->norequest_mask);
+       device_property_read_u32(dev, "st,norequest-mask", &stmpe_gpio->norequest_mask);
 
        ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO);
        if (ret)