From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv3] watchdog: add support for the Synopsys DesignWare WDT
Date: Fri, 7 Jan 2011 16:52:50 +0000 [thread overview]
Message-ID: <20110107165250.GU31708@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTi=s4Wuj1YyALL7f1AK-MQjvPre8mvviLhw5TdPH@mail.gmail.com>
On Fri, Jan 07, 2011 at 10:13:50PM +0530, viresh kumar wrote:
> > +
> > + ? ? ? dw_wdt.clk = clk_get(&pdev->dev, NULL);
> > + ? ? ? if (IS_ERR_OR_NULL(dw_wdt.clk))
> > + ? ? ? ? ? ? ? return -ENODEV;
>
> should release mem_region and free ioremaped space.
> Also, may be we can continue here in case of error too.
> Some platforms might nor support clock framework. You can enable and
> disable clk's
> if dw_wdt.clk is !NULL
And some platforms have been known to return NULL for clk_get() as they
don't support more than one clock.
arch/arm/mach-aaec2000/core.c:struct clk *clk_get(struct device *dev, const char *id)
arch/arm/mach-aaec2000/core.c-{
arch/arm/mach-aaec2000/core.c- return dev && strcmp(dev_name(dev), "mb:16") ==
0 ? NULL : ERR_PTR(-ENOENT);
--
arch/arm/mach-at91/at91x40.c:struct clk *clk_get(struct device *dev, const char
*id)
arch/arm/mach-at91/at91x40.c-{
arch/arm/mach-at91/at91x40.c- return NULL;
--
arch/arm/mach-netx/fb.c:struct clk *clk_get(struct device *dev, const char *id)
arch/arm/mach-netx/fb.c-{
arch/arm/mach-netx/fb.c- return dev && strcmp(dev_name(dev), "fb") == 0 ? NULL : ERR_PTR(-ENOENT);
Please stick to the conventions of the API in the driver. IS_ERR() values
mean we failed. Anything else must be considered success. Don't assume
NULL means we failed.
next prev parent reply other threads:[~2011-01-07 16:52 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 [this message]
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
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=20110107165250.GU31708@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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).