]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: gpio_decoder - make use of device properties
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 13 Nov 2025 15:44:42 +0000 (16:44 +0100)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 21 Jan 2026 20:22:43 +0000 (12:22 -0800)
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://patch.msgid.link/20251113154616.3107676-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/gpio_decoder.c

index ee668eba302fe3c159d89fa096ae7d8d7c6f06fe..459abc749a497b72c4f962a744d639e077f08c7e 100644 (file)
 #include <linux/gpio/consumer.h>
 #include <linux/input.h>
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 
 struct gpio_decoder {
        struct gpio_descs *input_gpios;
@@ -110,19 +111,17 @@ static int gpio_decoder_probe(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id gpio_decoder_of_match[] = {
        { .compatible = "gpio-decoder", },
-       { },
+       { }
 };
 MODULE_DEVICE_TABLE(of, gpio_decoder_of_match);
-#endif
 
 static struct platform_driver gpio_decoder_driver = {
        .probe          = gpio_decoder_probe,
        .driver         = {
                .name   = "gpio-decoder",
-               .of_match_table = of_match_ptr(gpio_decoder_of_match),
+               .of_match_table = gpio_decoder_of_match,
        }
 };
 module_platform_driver(gpio_decoder_driver);