From: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Lior Amsalem <alior-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>,
Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
Tawfik Bayouk <tawfik-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
Daniel Lezcano
<daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Wim Van Sebroeck <wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Gregory Clement
<gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>,
Sebastian Hesselbarth
<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v5 14/20] watchdog: orion: Add support for Armada 370 and Armada XP SoC
Date: Tue, 28 Jan 2014 07:27:50 -0300 [thread overview]
Message-ID: <20140128102750.GA13052@localhost> (raw)
In-Reply-To: <20140127173624.GT15937-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
On Mon, Jan 27, 2014 at 05:36:24PM +0000, Russell King - ARM Linux wrote:
[..]
> > +static int armadaxp_wdt_clock_init(struct platform_device *pdev,
> > + struct orion_watchdog *dev)
> > +{
> > + int ret;
> > +
> > + dev->clk = of_clk_get_by_name(pdev->dev.of_node, "fixed");
> > + if (IS_ERR(dev->clk))
> > + return PTR_ERR(dev->clk);
> > + ret = clk_prepare_enable(dev->clk);
> > + if (ret)
> > + return ret;
> > +
> > + /* Enable the fixed watchdog clock input */
> > + atomic_io_modify(dev->reg + TIMER_CTRL,
> > + WDT_AXP_FIXED_ENABLE_BIT,
> > + WDT_AXP_FIXED_ENABLE_BIT);
> > +
> > + dev->clk_rate = clk_get_rate(dev->clk);
> > + return 0;
> > +}
>
> Doesn't this result in dev->clk being leaked? Or at least a difference
> in the way dev->clk needs to be cleaned up between these two functions?
>
Yes, indeed.
> I think it would be better in this case to use the standard clk_get() in
> the first function and always use clk_put()... until there is a devm_*
> version of the of_clk_get* functions.
>
Sound good.
Thanks,
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-01-28 10:27 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 15:27 [PATCH v5 00/20] Armada 370/XP watchdog support Ezequiel Garcia
[not found] ` <1390836440-12744-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-27 15:27 ` [PATCH v5 01/20] ARM: Introduce atomic MMIO modify Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 02/20] clocksource: orion: Use atomic access for shared registers Ezequiel Garcia
[not found] ` <1390836440-12744-3-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-02-05 19:10 ` Jason Cooper
[not found] ` <20140205191035.GZ8533-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2014-02-05 23:19 ` Ezequiel Garcia
2014-02-06 23:47 ` Daniel Lezcano
2014-01-27 15:27 ` [PATCH v5 03/20] watchdog: orion: Add clock error handling Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 04/20] watchdog: orion: Use atomic access for shared registers Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 05/20] watchdog: orion: Remove unused macros Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 06/20] watchdog: orion: Make sure the watchdog is initially stopped Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 07/20] watchdog: orion: Handle the interrupt so it's properly acked Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 08/20] watchdog: orion: Make RSTOUT register a separate resource Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 09/20] watchdog: orion: Remove unneeded BRIDGE_CAUSE clear Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 10/20] watchdog: orion: Introduce an orion_watchdog device structure Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 11/20] watchdog: orion: Introduce per-compatible of_device_id data Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 12/20] watchdog: orion: Add per-compatible clock initialization Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 13/20] watchdog: orion: Add per-compatible watchdog start implementation Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 14/20] watchdog: orion: Add support for Armada 370 and Armada XP SoC Ezequiel Garcia
[not found] ` <1390836440-12744-15-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-27 17:36 ` Russell King - ARM Linux
[not found] ` <20140127173624.GT15937-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2014-01-28 10:27 ` Ezequiel Garcia [this message]
2014-01-27 15:27 ` [PATCH v5 15/20] ARM: mvebu: Enable Armada 370/XP watchdog in the devicetree Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 16/20] ARM: kirkwood: Add RSTOUT 'reg' entry to devicetree Ezequiel Garcia
[not found] ` <1390836440-12744-17-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-29 20:15 ` Andrew Lunn
2014-01-27 15:27 ` [PATCH v5 17/20] ARM: dove: Enable Dove watchdog in the devicetree Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 18/20] watchdog: orion: Enable the build on ARCH_MVEBU Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 19/20] ARM: mvebu: Enable watchdog support in defconfig Ezequiel Garcia
2014-01-27 15:27 ` [PATCH v5 20/20] ARM: dove: Enable watchdog support in the defconfig Ezequiel Garcia
2014-01-29 18:19 ` [PATCH v5 00/20] Armada 370/XP watchdog support Ezequiel Garcia
2014-01-30 20:53 ` Jason Cooper
[not found] ` <20140130205315.GD29184-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2014-01-30 21:50 ` Ezequiel Garcia
2014-01-30 22:00 ` Sebastian Hesselbarth
[not found] ` <52EACB92.2080700-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-01-30 22:16 ` Jason Cooper
2014-01-30 22:37 ` Ezequiel Garcia
2014-01-31 17:25 ` Willy Tarreau
2014-02-05 19:06 ` Jason Cooper
2014-01-27 15:50 ` Jason Cooper
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=20140128102750.GA13052@localhost \
--to=ezequiel.garcia-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=alior-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
--cc=andrew-g2DYL2Zd6BY@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
--cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tawfik-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
--cc=wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.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).