From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@kernel.org>
Cc: lgirdwood@gmail.com, linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] regulator: core: Get and put regulator of_node
Date: Wed, 2 Apr 2014 17:04:38 +0100 [thread overview]
Message-ID: <20140402160438.GO1665@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20140402142356.GE2269@sirena.org.uk>
On Wed, Apr 02, 2014 at 03:23:56PM +0100, Mark Brown wrote:
> On Wed, Apr 02, 2014 at 03:06:54PM +0100, Charles Keepax wrote:
>
> > We should be incrementing the reference count of the of_node for the
> > regulator when we take a copy of it. This patch does so.
>
> Why?
>
> Note that in any case this is going to have absolutely no impact on
> practical systems since everything using regulators uses FDT at the
> minute.
Apologies I must be missing something, take for example the fixed
regulator driver (fixed.c). We get an of_node from
pdev->dev->of_node, pull the init_data from it, then copy the
of_node into the regulator_config and call regulator_register.
regulator_register will copy the of_node from the regulator_config
and put it into the new device, but as far as I can see no one ever
incremented the reference count?
of_node = pdev->dev.of_node;
drvdata->dev = regulator_register(&drvdata->desc, &cfg);
Looks like there are a couple of other regulator drivers in the
same boat. Just seems easier to let the core do the reference
stuff rather than needing to do it in the drivers.
Thanks,
Charles
next prev parent reply other threads:[~2014-04-02 16:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 14:06 [PATCH] regulator: core: Get and put regulator of_node Charles Keepax
2014-04-02 14:23 ` Mark Brown
2014-04-02 16:04 ` Charles Keepax [this message]
2014-04-02 16:53 ` Mark Brown
2014-04-03 10:58 ` Charles Keepax
2014-04-03 11:14 ` Mark Brown
2014-04-03 11:48 ` Charles Keepax
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=20140402160438.GO1665@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
/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.