mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wim Van Sebroeck <wim@iguana.be>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: Marc Vertes <marc.vertes@sigfox.com>,
	linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org,
	Dimitry Andric <dimitry.andric@tomtom.com>,
	Ben Dooks <ben@simtec.co.uk>
Subject: Re: [PATCH] watchdog: fix nowayout setting in s3c2410_wdt
Date: Tue, 29 Nov 2011 10:56:43 +0100	[thread overview]
Message-ID: <20111129095643.GH23376@infomag.iguana.be> (raw)
In-Reply-To: <20111126102915.GA7517@pengutronix.de>

Hi Wolfram,

> > Set nowayout flag in probe function, otherwise option is useless.
> > 
> > Signed-off-by: Marc Vertes <marc.vertes@sigfox.com>
> 
> Similar as
> 
> http://www.spinics.net/lists/linux-watchdog/msg00704.html
> 
> which depends on
> 
> http://www.spinics.net/lists/linux-watchdog/msg00703.html
> 
> which has the advantage that it can be used for static initialization.

Hmm, I was more thinking about a wrapper function like the following:

diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 111843f..d8ef9b2 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -53,6 +53,8 @@ struct watchdog_info {
 
 #ifdef __KERNEL__
 
+#include <linux/bitops.h>
+
 #ifdef CONFIG_WATCHDOG_NOWAYOUT
 #define WATCHDOG_NOWAYOUT	1
 #else
@@ -122,6 +124,13 @@ struct watchdog_device {
 #define WDOG_NO_WAY_OUT		3	/* Is 'nowayout' feature set ? */
 };
 
+/* Use the following function to set the nowayout feature */
+static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout)
+{
+	if (nowayout)
+		set_bit(WDOG_NO_WAY_OUT, &wdd->status);
+}
+
 /* Use the following functions to manipulate watchdog driver specific data */
 static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
 {

but: .status = WATCHDOG_NOWAYOUT_INIT_STATUS, is also a nice one to have.

I propose to add both options and to document them in the documentation.
Objections anyone?

Kind regards,
Wim.


  reply	other threads:[~2011-11-29 10:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25 23:38 Marc Vertes
2011-11-26 10:29 ` Wolfram Sang
2011-11-29  9:56   ` Wim Van Sebroeck [this message]
2011-11-29 10:21     ` Wolfram Sang
2011-11-29 10:44       ` Wim Van Sebroeck

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=20111129095643.GH23376@infomag.iguana.be \
    --to=wim@iguana.be \
    --cc=ben@simtec.co.uk \
    --cc=dimitry.andric@tomtom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=marc.vertes@sigfox.com \
    --cc=w.sang@pengutronix.de \
    /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

all inboxes | Powered by JetHome®