mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Artamonow <mad_soft@inbox.ru>
To: linux-watchdog@vger.kernel.org
Cc: Timur Tabi <timur@freescale.com>,
	Kumar Gala <galak@kernel.crashing.org>,
	Wim Van Sebroeck <wim@iguana.be>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] watchdog: fix GETTIMEOUT ioctl in booke_wdt
Date: Thu, 26 Jan 2012 23:24:30 +0400	[thread overview]
Message-ID: <1327605870-9226-1-git-send-email-mad_soft@inbox.ru> (raw)

Commit dcfb748422 ([WATCHDOG] fix book E watchdog to take
WDIOC_SETTIMEOUT arg in seconds) fixed SETTIMEOUT ioctl
to use seconds as a parameter instead of some hardware-specific
"period", but missed to apply similar changes to GETTIMEOUT,
so it still returns "period" value. Let's fix it!
Also, while at it, make SETTIMEOUT ioctl return real timeout
value as it should do according to the documentation.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
---
 drivers/watchdog/booke_wdt.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

NOTE: 
I'm no longer have a hardware, so it haven't been tested actually. 
It would be nice if anyone could test it on some BookE platform.

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 337265b..7c0fdfc 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -198,9 +198,13 @@ static long booke_wdt_ioctl(struct file *file,
 		booke_wdt_period = tmp;
 #endif
 		booke_wdt_set();
-		return 0;
+		/* Fall */
 	case WDIOC_GETTIMEOUT:
+#ifdef	CONFIG_FSL_BOOKE
+		return put_user(period_to_sec(booke_wdt_period), p);
+#else
 		return put_user(booke_wdt_period, p);
+#endif
 	default:
 		return -ENOTTY;
 	}
-- 
1.7.5.4


             reply	other threads:[~2012-01-26 19:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26 19:24 Dmitry Artamonow [this message]
2012-01-27 21:08 ` Timur Tabi
2012-01-27 21:22   ` Timur Tabi
2012-01-27 21:34 ` Timur Tabi

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=1327605870-9226-1-git-send-email-mad_soft@inbox.ru \
    --to=mad_soft@inbox.ru \
    --cc=galak@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=timur@freescale.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

all inboxes | Powered by JetHome®