Re: [PATCH] regulator: core: Get and put regulator of_node

2014-04-03 Thread Charles Keepax
On Thu, Apr 03, 2014 at 12:14:31PM +0100, Mark Brown wrote: > On Thu, Apr 03, 2014 at 11:58:04AM +0100, Charles Keepax wrote: > > The main issue I have is that devm_regualtor_register is a bit > > awkward. With regulator_register you will always be calling > > regulator_unregister so you can put th

Re: [PATCH] regulator: core: Get and put regulator of_node

2014-04-03 Thread Mark Brown
On Thu, Apr 03, 2014 at 11:58:04AM +0100, Charles Keepax wrote: > On Wed, Apr 02, 2014 at 05:53:54PM +0100, Mark Brown wrote: > > To make this correct we need to at least ensure that the node passed > > into the regulator API is valid and referenced at that time so there > > should only be an issu

Re: [PATCH] regulator: core: Get and put regulator of_node

2014-04-03 Thread Charles Keepax
On Wed, Apr 02, 2014 at 05:53:54PM +0100, Mark Brown wrote: > To make this correct we need to at least ensure that the node passed > into the regulator API is valid and referenced at that time so there > should only be an issue for the core if the reference is dropped after > that. In the above ca

Re: [PATCH] regulator: core: Get and put regulator of_node

2014-04-02 Thread Mark Brown
On Wed, Apr 02, 2014 at 05:04:38PM +0100, Charles Keepax wrote: > 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

Re: [PATCH] regulator: core: Get and put regulator of_node

2014-04-02 Thread Charles Keepax
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

Re: [PATCH] regulator: core: Get and put regulator of_node

2014-04-02 Thread Mark Brown
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 every

[PATCH] regulator: core: Get and put regulator of_node

2014-04-02 Thread Charles Keepax
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. Signed-off-by: Charles Keepax --- drivers/regulator/core.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/r