linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] driver: input: twl6040-vibra: fix missing of_node_put
@ 2013-08-31  6:45 Libo Chen
  2013-09-01 16:59 ` Peter Ujfalusi
  0 siblings, 1 reply; 2+ messages in thread
From: Libo Chen @ 2013-08-31  6:45 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: Bill Pemberton, peter.ujfalusi, broonie, javier, linux-input,
	LKML, Li Zefan, zhangwei(Jovi)


decrease twl6040_core_node device_node refcount after task completion

There are two ways to implement the function of_node_put through
the marco CONFIG_OF_DYNAMIC, so it is save to call directly.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
 drivers/input/misc/twl6040-vibra.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c
index 0c2dfc8..f16193a 100644
--- a/drivers/input/misc/twl6040-vibra.c
+++ b/drivers/input/misc/twl6040-vibra.c
@@ -271,12 +271,14 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
 #endif

 	if (!pdata && !twl6040_core_node) {
+		of_node_put(twl6040_core_node);
 		dev_err(&pdev->dev, "platform_data not available\n");
 		return -EINVAL;
 	}

 	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
 	if (!info) {
+		of_node_put(twl6040_core_node);
 		dev_err(&pdev->dev, "couldn't allocate memory\n");
 		return -ENOMEM;
 	}
@@ -304,6 +306,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
 				     &vddvibl_uV);
 		of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV",
 				     &vddvibr_uV);
+		of_node_put(twl6040_core_node);
 	}

 	if ((!info->vibldrv_res && !info->viblmotor_res) ||
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3] driver: input: twl6040-vibra: fix missing of_node_put
  2013-08-31  6:45 [PATCH 3/3] driver: input: twl6040-vibra: fix missing of_node_put Libo Chen
@ 2013-09-01 16:59 ` Peter Ujfalusi
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Ujfalusi @ 2013-09-01 16:59 UTC (permalink / raw)
  To: Libo Chen
  Cc: dmitry.torokhov, Bill Pemberton, broonie, javier, linux-input,
	LKML, Li Zefan, zhangwei(Jovi)

On 08/31/2013 09:45 AM, Libo Chen wrote:
> 
> decrease twl6040_core_node device_node refcount after task completion
> 
> There are two ways to implement the function of_node_put through
> the marco CONFIG_OF_DYNAMIC, so it is save to call directly.
> 
> Signed-off-by: Libo Chen <libo.chen@huawei.com>

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> ---
>  drivers/input/misc/twl6040-vibra.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c
> index 0c2dfc8..f16193a 100644
> --- a/drivers/input/misc/twl6040-vibra.c
> +++ b/drivers/input/misc/twl6040-vibra.c
> @@ -271,12 +271,14 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
>  #endif
> 
>  	if (!pdata && !twl6040_core_node) {
> +		of_node_put(twl6040_core_node);
>  		dev_err(&pdev->dev, "platform_data not available\n");
>  		return -EINVAL;
>  	}
> 
>  	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
>  	if (!info) {
> +		of_node_put(twl6040_core_node);
>  		dev_err(&pdev->dev, "couldn't allocate memory\n");
>  		return -ENOMEM;
>  	}
> @@ -304,6 +306,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
>  				     &vddvibl_uV);
>  		of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV",
>  				     &vddvibr_uV);
> +		of_node_put(twl6040_core_node);
>  	}
> 
>  	if ((!info->vibldrv_res && !info->viblmotor_res) ||
> 


-- 
Péter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-01 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-31  6:45 [PATCH 3/3] driver: input: twl6040-vibra: fix missing of_node_put Libo Chen
2013-09-01 16:59 ` Peter Ujfalusi

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).