All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	Ralf Baechle <ralf@linux-mips.org>,
	Wim Van Sebroeck <wim@iguana.be>,
	linux-watchdog@vger.kernel.org
Subject: [PATCH] watchdog: Fix build error in txx9wdt.c
Date: Mon, 26 Mar 2012 13:02:14 +0800	[thread overview]
Message-ID: <1332738134.10660.1.camel@phoenix> (raw)

we need to get clk_get_rate(txx9_imclk) before using WD_MAX_TIMEOUT.

This patch fixes below build errors:
  CC      drivers/watchdog/txx9wdt.o
drivers/watchdog/txx9wdt.c:104: error: initializer element is not constant
drivers/watchdog/txx9wdt.c:104: error: (near initialization for ‘txx9wdt.max_timeout’)
make[2]: *** [drivers/watchdog/txx9wdt.o] Error 1
make[1]: *** [drivers/watchdog] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/watchdog/txx9wdt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/txx9wdt.c b/drivers/watchdog/txx9wdt.c
index f9afe2f..98e1637 100644
--- a/drivers/watchdog/txx9wdt.c
+++ b/drivers/watchdog/txx9wdt.c
@@ -100,8 +100,6 @@ static const struct watchdog_ops txx9wdt_ops = {
 static struct watchdog_device txx9wdt = {
 	.info = &txx9wdt_info,
 	.ops = &txx9wdt_ops,
-	.min_timeout = 1,
-	.max_timeout = WD_MAX_TIMEOUT,
 };
 
 static int __init txx9wdt_probe(struct platform_device *dev)
@@ -132,6 +130,8 @@ static int __init txx9wdt_probe(struct platform_device *dev)
 	if (timeout < 1 || timeout > WD_MAX_TIMEOUT)
 		timeout = TIMER_MARGIN;
 	txx9wdt.timeout = timeout;
+	txx9wdt.min_timeout = 1;
+	txx9wdt.max_timeout = WD_MAX_TIMEOUT;
 	watchdog_set_nowayout(&txx9wdt, nowayout);
 
 	ret = watchdog_register_device(&txx9wdt);
-- 
1.7.5.4



--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	Ralf Baechle <ralf@linux-mips.org>,
	Wim Van Sebroeck <wim@iguana.be>,
	linux-watchdog@vger.kernel.org
Subject: [PATCH] watchdog: Fix build error in txx9wdt.c
Date: Mon, 26 Mar 2012 13:02:14 +0800	[thread overview]
Message-ID: <1332738134.10660.1.camel@phoenix> (raw)

we need to get clk_get_rate(txx9_imclk) before using WD_MAX_TIMEOUT.

This patch fixes below build errors:
  CC      drivers/watchdog/txx9wdt.o
drivers/watchdog/txx9wdt.c:104: error: initializer element is not constant
drivers/watchdog/txx9wdt.c:104: error: (near initialization for ‘txx9wdt.max_timeout’)
make[2]: *** [drivers/watchdog/txx9wdt.o] Error 1
make[1]: *** [drivers/watchdog] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/watchdog/txx9wdt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/txx9wdt.c b/drivers/watchdog/txx9wdt.c
index f9afe2f..98e1637 100644
--- a/drivers/watchdog/txx9wdt.c
+++ b/drivers/watchdog/txx9wdt.c
@@ -100,8 +100,6 @@ static const struct watchdog_ops txx9wdt_ops = {
 static struct watchdog_device txx9wdt = {
 	.info = &txx9wdt_info,
 	.ops = &txx9wdt_ops,
-	.min_timeout = 1,
-	.max_timeout = WD_MAX_TIMEOUT,
 };
 
 static int __init txx9wdt_probe(struct platform_device *dev)
@@ -132,6 +130,8 @@ static int __init txx9wdt_probe(struct platform_device *dev)
 	if (timeout < 1 || timeout > WD_MAX_TIMEOUT)
 		timeout = TIMER_MARGIN;
 	txx9wdt.timeout = timeout;
+	txx9wdt.min_timeout = 1;
+	txx9wdt.max_timeout = WD_MAX_TIMEOUT;
 	watchdog_set_nowayout(&txx9wdt, nowayout);
 
 	ret = watchdog_register_device(&txx9wdt);
-- 
1.7.5.4




             reply	other threads:[~2012-03-26  5:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26  5:02 Axel Lin [this message]
2012-03-26  5:02 ` [PATCH] watchdog: Fix build error in txx9wdt.c Axel Lin
2012-03-26  6:37 ` Wolfram Sang

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=1332738134.10660.1.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.