From: Roland Stigge <stigge@antcom.de>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: linux-watchdog@vger.kernel.org, Wim Van Sebroeck <wim@iguana.be>
Subject: Re: [PATCH 2/4] watchdog: pnx4008: don't use __raw_-accessors
Date: Thu, 02 Feb 2012 21:04:26 +0100 [thread overview]
Message-ID: <4F2AEC4A.6050200@antcom.de> (raw)
In-Reply-To: <1328204891-32551-3-git-send-email-w.sang@pengutronix.de>
On 02/02/2012 06:48 PM, Wolfram Sang wrote:
> __raw_readl/__raw_writel are not meant for drivers [1].
>
> [1] http://thread.gmane.org/gmane.linux.ports.arm.kernel/117626
>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
> drivers/watchdog/pnx4008_wdt.c | 21 ++++++++++-----------
> 1 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
> index 322a392..6010602 100644
> --- a/drivers/watchdog/pnx4008_wdt.c
> +++ b/drivers/watchdog/pnx4008_wdt.c
> @@ -97,22 +97,21 @@ static void wdt_enable(void)
> spin_lock(&io_lock);
>
> /* stop counter, initiate counter reset */
> - __raw_writel(RESET_COUNT, WDTIM_CTRL(wdt_base));
> + writel(RESET_COUNT, WDTIM_CTRL(wdt_base));
> /*wait for reset to complete. 100% guarantee event */
> - while (__raw_readl(WDTIM_COUNTER(wdt_base)))
> + while (readl(WDTIM_COUNTER(wdt_base)))
> cpu_relax();
> /* internal and external reset, stop after that */
> - __raw_writel(M_RES2 | STOP_COUNT0 | RESET_COUNT0,
> - WDTIM_MCTRL(wdt_base));
> + writel(M_RES2 | STOP_COUNT0 | RESET_COUNT0, WDTIM_MCTRL(wdt_base));
> /* configure match output */
> - __raw_writel(MATCH_OUTPUT_HIGH, WDTIM_EMR(wdt_base));
> + writel(MATCH_OUTPUT_HIGH, WDTIM_EMR(wdt_base));
> /* clear interrupt, just in case */
> - __raw_writel(MATCH_INT, WDTIM_INT(wdt_base));
> + writel(MATCH_INT, WDTIM_INT(wdt_base));
> /* the longest pulse period 65541/(13*10^6) seconds ~ 5 ms. */
> - __raw_writel(0xFFFF, WDTIM_PULSE(wdt_base));
> - __raw_writel(heartbeat * WDOG_COUNTER_RATE, WDTIM_MATCH0(wdt_base));
> + writel(0xFFFF, WDTIM_PULSE(wdt_base));
> + writel(heartbeat * WDOG_COUNTER_RATE, WDTIM_MATCH0(wdt_base));
> /*enable counter, stop when debugger active */
> - __raw_writel(COUNT_ENAB | DEBUG_EN, WDTIM_CTRL(wdt_base));
> + writel(COUNT_ENAB | DEBUG_EN, WDTIM_CTRL(wdt_base));
>
> spin_unlock(&io_lock);
> }
> @@ -121,7 +120,7 @@ static void wdt_disable(void)
> {
> spin_lock(&io_lock);
>
> - __raw_writel(0, WDTIM_CTRL(wdt_base)); /*stop counter */
> + writel(0, WDTIM_CTRL(wdt_base)); /*stop counter */
>
> spin_unlock(&io_lock);
> }
> @@ -277,7 +276,7 @@ static int __devinit pnx4008_wdt_probe(struct platform_device *pdev)
> goto disable_clk;
> }
>
> - boot_status = (__raw_readl(WDTIM_RES(wdt_base)) &
> + boot_status = (readl(WDTIM_RES(wdt_base)) &
> WDOG_RESET) ? WDIOF_CARDRESET : 0;
> wdt_disable(); /*disable for now */
> clk_disable(wdt_clk);
Tested-by: Roland Stigge <stigge@antcom.de>
next prev parent reply other threads:[~2012-02-02 20:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-02 17:48 [PATCH 0/4] pnx4008: convert to watchdog framework Wolfram Sang
2012-02-02 17:48 ` [PATCH 1/4] watchdog: pnx4008: cleanup resource handling using managed devices Wolfram Sang
2012-02-02 20:04 ` Roland Stigge
2012-02-02 17:48 ` [PATCH 2/4] watchdog: pnx4008: don't use __raw_-accessors Wolfram Sang
2012-02-02 20:04 ` Roland Stigge [this message]
2012-02-02 17:48 ` [PATCH 3/4] watchdog: dev: don't enforce set_timeout() Wolfram Sang
2012-02-02 20:04 ` Roland Stigge
2012-03-14 18:40 ` Wolfram Sang
2012-03-15 21:18 ` Wim Van Sebroeck
2012-02-02 17:48 ` [PATCH 4/4] watchdog: pnx4008: convert driver to use the watchdog framework Wolfram Sang
2012-02-02 20:04 ` Roland Stigge
2012-02-02 20:02 ` [PATCH 0/4] pnx4008: convert to " Roland Stigge
2012-02-02 20:23 ` 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=4F2AEC4A.6050200@antcom.de \
--to=stigge@antcom.de \
--cc=linux-watchdog@vger.kernel.org \
--cc=w.sang@pengutronix.de \
--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.