linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wim@iguana.be (Wim Van Sebroeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv3] watchdog: add support for the Synopsys DesignWare WDT
Date: Sun, 9 Jan 2011 11:07:32 +0100	[thread overview]
Message-ID: <20110109100732.GJ3801@infomag.iguana.be> (raw)
In-Reply-To: <1294401797-24158-1-git-send-email-jamie@jamieiles.com>

Hi Jamie,

On top of other comments from Viresh:

> +static int dw_wdt_open(struct inode *inode, struct file *filp)
> +{
> +	/* Make sure we don't get unloaded. */
> +	__module_get(THIS_MODULE);
> +
> +	spin_lock(&dw_wdt.lock);
> +	if (!dw_wdt_is_enabled()) {
> +		/*
> +		 * The watchdog is not currently enabled. Set the timeout to
> +		 * the maximum and then start it.
> +		 */
> +		dw_wdt_set_top(DW_WDT_MAX_TOP);
> +		writel(WDOG_CONTROL_REG_WDT_EN_MASK,
> +		       dw_wdt.regs + WDOG_CONTROL_REG_OFFSET);
> +	}
> +	spin_unlock(&dw_wdt.lock);
> +
> +	return nonseekable_open(inode, filp);
> +}

Would be nice to have the open /dev/watchdog once protection here also.

> +static int __devexit dw_wdt_drv_remove(struct platform_device *pdev)
> +{
> +	clk_disable(dw_wdt.clk);
> +	clk_put(dw_wdt.clk);
> +
> +	misc_deregister(&dw_wdt_miscdev);
> +
> +	return 0;
> +}

misc_deregister (=link to user-space) should be called before the clk_disabel calls.

Kind regards,
Wim.

      parent reply	other threads:[~2011-01-09 10:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 12:03 [PATCHv3] watchdog: add support for the Synopsys DesignWare WDT Jamie Iles
2011-01-07 16:43 ` viresh kumar
2011-01-07 16:52   ` Russell King - ARM Linux
2011-01-07 17:56     ` Jamie Iles
2011-01-07 18:09       ` Russell King - ARM Linux
2011-01-07 18:47         ` Jamie Iles
2011-01-07 17:08   ` Jamie Iles
2011-01-07 17:17     ` viresh kumar
2011-01-09 10:07 ` Wim Van Sebroeck [this message]

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=20110109100732.GJ3801@infomag.iguana.be \
    --to=wim@iguana.be \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).