lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1367596606-22476-2-git-send-email-linux@roeck-us.net>
Date:	Fri,  3 May 2013 08:56:46 -0700
From:	Guenter Roeck <linux@...ck-us.net>
To:	linux-watchdog@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, Guenter Roeck <linux@...ck-us.net>,
	Dirk Eibach <dirk.eibach@...ys.cc>
Subject: [RFC PATCH 2/2] watchdog: booke: Add device tree support

Enable timeout initialization from device tree data.

Cc: Dirk Eibach <dirk.eibach@...ys.cc>
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
---
Compile tested only. Need to determine final "compatible" strings
documentation of properties.

 drivers/watchdog/booke_wdt.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 9b066b9..d433675 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -18,6 +18,7 @@
 #include <linux/smp.h>
 #include <linux/watchdog.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 #include <asm/reg_booke.h>
 #include <asm/time.h>
@@ -238,8 +239,10 @@ static int booke_wdt_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "powerpc book-e watchdog driver loaded\n");
 
 	booke_wdt_info.firmware_version = cur_cpu_spec->pvr_value;
-	booke_wdt_set_timeout(&booke_wdt_dev,
-			      period_to_sec(CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT));
+	watchdog_init_timeout(&booke_wdt_dev,
+			      period_to_sec(CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT),
+			      &pdev->dev);
+	booke_wdt_set_timeout(&booke_wdt_dev, booke_wdt_dev.timeout);
 	watchdog_set_nowayout(&booke_wdt_dev, nowayout);
 	if (booke_wdt_enabled)
 		__booke_wdt_start(&booke_wdt_dev);
@@ -249,6 +252,13 @@ static int booke_wdt_probe(struct platform_device *pdev)
 	return ret;
 }
 
+static const struct of_device_id booke_wdt_of_match[] = {
+	{ .compatible = "booke_wdt", },
+	{ .compatible = "fsl,booke-wdt", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, booke_wdt_of_match);
+
 static struct platform_driver booke_wdt_driver = {
 	.probe = booke_wdt_probe,
 	.remove = booke_wdt_remove,
@@ -256,6 +266,7 @@ static struct platform_driver booke_wdt_driver = {
 	.driver = {
 		.owner  = THIS_MODULE,
 		.name = "booke_wdt",
+		.of_match_table = booke_wdt_of_match,
 	},
 };
 
-- 
1.7.9.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ