From: Linus Walleij Date: Thu, 19 Oct 2017 23:28:46 +0000 (-0700) Subject: Input: gpio_mouse - add device tree probing X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=adb77b3e5118d2760621d8cc740524b816f9006b;p=linux.git Input: gpio_mouse - add device tree probing This makes the GPIO mouse probe nicely from the device tree if found in a tree. As the driver uses device properties it can easily be amended to also probe from ACPI devices. Acked-by: Hans-Christian Noren Egtvedt Signed-off-by: Linus Walleij Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c index 6cd7159f1003b..a26d8be6f7959 100644 --- a/drivers/input/mouse/gpio_mouse.c +++ b/drivers/input/mouse/gpio_mouse.c @@ -14,6 +14,7 @@ #include #include #include +#include /** * struct gpio_mouse @@ -156,10 +157,17 @@ static int gpio_mouse_probe(struct platform_device *pdev) return 0; } +static const struct of_device_id gpio_mouse_of_match[] = { + { .compatible = "gpio-mouse", }, + { }, +}; +MODULE_DEVICE_TABLE(of, gpio_mouse_of_match); + static struct platform_driver gpio_mouse_device_driver = { .probe = gpio_mouse_probe, .driver = { .name = "gpio_mouse", + .of_match_table = gpio_mouse_of_match, } }; module_platform_driver(gpio_mouse_device_driver);