Skip to content

Commit c83504a

Browse files
andy-shevdtor
authored andcommitted
Input: gpio_decoder - make use of device properties
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>
1 parent 6cebd8e commit c83504a

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/input/misc/gpio_decoder.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
#include <linux/gpio/consumer.h>
1111
#include <linux/input.h>
1212
#include <linux/kernel.h>
13+
#include <linux/mod_devicetable.h>
1314
#include <linux/module.h>
14-
#include <linux/of.h>
1515
#include <linux/platform_device.h>
16+
#include <linux/property.h>
1617

1718
struct gpio_decoder {
1819
struct gpio_descs *input_gpios;
@@ -110,19 +111,17 @@ static int gpio_decoder_probe(struct platform_device *pdev)
110111
return 0;
111112
}
112113

113-
#ifdef CONFIG_OF
114114
static const struct of_device_id gpio_decoder_of_match[] = {
115115
{ .compatible = "gpio-decoder", },
116-
{ },
116+
{ }
117117
};
118118
MODULE_DEVICE_TABLE(of, gpio_decoder_of_match);
119-
#endif
120119

121120
static struct platform_driver gpio_decoder_driver = {
122121
.probe = gpio_decoder_probe,
123122
.driver = {
124123
.name = "gpio-decoder",
125-
.of_match_table = of_match_ptr(gpio_decoder_of_match),
124+
.of_match_table = gpio_decoder_of_match,
126125
}
127126
};
128127
module_platform_driver(gpio_decoder_driver);

0 commit comments

Comments
 (0)