Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[firefly-linux-kernel-4.4.55.git] / drivers / watchdog / jz4740_wdt.c
index 18e41afa4da38c53e4f0f6bdb55dcbec6ba151d6..4c2cc09c0c5780ec859c8643c65e887bfd3b0b54 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/clk.h>
 #include <linux/slab.h>
 #include <linux/err.h>
+#include <linux/of.h>
 
 #include <asm/mach-jz4740/timer.h>
 
@@ -142,6 +143,14 @@ static const struct watchdog_ops jz4740_wdt_ops = {
        .set_timeout = jz4740_wdt_set_timeout,
 };
 
+#ifdef CONFIG_OF
+static const struct of_device_id jz4740_wdt_of_matches[] = {
+       { .compatible = "ingenic,jz4740-watchdog", },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, jz4740_wdt_of_matches)
+#endif
+
 static int jz4740_wdt_probe(struct platform_device *pdev)
 {
        struct jz4740_wdt_drvdata *drvdata;
@@ -211,6 +220,7 @@ static struct platform_driver jz4740_wdt_driver = {
        .remove = jz4740_wdt_remove,
        .driver = {
                .name = "jz4740-wdt",
+               .of_match_table = of_match_ptr(jz4740_wdt_of_matches),
        },
 };