From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Wim Van Sebroeck <wim@iguana.be>,
linux-watchdog@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Andrew Victor <linux@maxim.org.za>,
Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
devicetree-discuss@lists.ozlabs.org
Subject: Re: [RFC PATCH v3 1/4] watchdog: core: dt: add support for the timeout-sec dt property
Date: Fri, 5 Oct 2012 13:16:42 +0200 [thread overview]
Message-ID: <20121005111642.GA12462@game.jcrosoft.org> (raw)
In-Reply-To: <1349432169-13006-2-git-send-email-fabio.porcedda@gmail.com>
On 12:16 Fri 05 Oct , Fabio Porcedda wrote:
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> ---
> Documentation/watchdog/watchdog-kernel-api.txt | 4 ++++
> drivers/watchdog/watchdog_core.c | 27 ++++++++++++++++++++++++++
> include/linux/watchdog.h | 4 ++++
> 3 files changed, 35 insertions(+)
>
> diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt
> index 086638f..2208db7 100644
> --- a/Documentation/watchdog/watchdog-kernel-api.txt
> +++ b/Documentation/watchdog/watchdog-kernel-api.txt
> @@ -212,3 +212,7 @@ driver specific data to and a pointer to the data itself.
> The watchdog_get_drvdata function allows you to retrieve driver specific data.
> The argument of this function is the watchdog device where you want to retrieve
> data from. The function returns the pointer to the driver specific data.
> +
> +The watchdog_init_timeout function allows you to initialize the timeout field
> +using the module timeout parameter or retrieving the timeout-sec property from
> +the device tree.
> diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
> index 3796434..646be48 100644
> --- a/drivers/watchdog/watchdog_core.c
> +++ b/drivers/watchdog/watchdog_core.c
> @@ -143,6 +143,33 @@ void watchdog_unregister_device(struct watchdog_device *wdd)
> }
> EXPORT_SYMBOL_GPL(watchdog_unregister_device);
>
> +/**
> + * watchdog_init_timeout() - initialize the timeout field
> + * @parm_timeout: timeout module parameter, it takes precedence over the
> + * timeout-sec property.
> + * @node: Retrieve the timeout-sec property only if the parm_timeout
> + * is out of bounds.
> + */
> +void watchdog_init_timeout(struct watchdog_device *wdd,
> + unsigned int parm_timeout, struct device_node *node)
> +{
> + unsigned int t = 0;
> +
> + if ((parm_timeout >= wdd->min_timeout) &&
> + (parm_timeout <= wdd->max_timeout)) {
> + wdd->timeout = parm_timeout;
> + return;
> + }
> +
> + if (!node)
> + return;
> +
> + of_property_read_u32(node, "timeout-sec", &t);
why I bother to comment
*make this of generic* this is not watchdog specific other driver can use it
Best Regards,
J.
next prev parent reply other threads:[~2012-10-05 11:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-05 10:16 [RFC PATCH v3 0/4] watchdog: core: dt: add support for the timeout-sec dt property Fabio Porcedda
2012-10-05 10:16 ` [RFC PATCH v3 1/4] " Fabio Porcedda
2012-10-05 11:16 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-10-05 12:06 ` Fabio Porcedda
2012-10-05 10:16 ` [RFC PATCH v3 2/4] watchdog: add timeout-sec property binding to some drivers Fabio Porcedda
2012-10-05 10:16 ` [RFC PATCH v3 3/4] watchdog: orion_wdt: litte cleanup Fabio Porcedda
2012-10-05 10:16 ` [RFC PATCH v3 4/4] watchdog: WatchDog Timer Driver Core: fix comment Fabio Porcedda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121005111642.GA12462@game.jcrosoft.org \
--to=plagnioj@jcrosoft.com \
--cc=andrew@lunn.ch \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=fabio.porcedda@gmail.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@maxim.org.za \
--cc=nicolas.ferre@atmel.com \
--cc=wim@iguana.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).