From: Libo Chen <clbchenlibo.chen@huawei.com>
To: dmitry.torokhov@gmail.com
Cc: Bill Pemberton <wfp5p@virginia.edu>,
peter.ujfalusi@ti.com, broonie@opensource.wolfsonmicro.com,
javier@dowhile0.org, linux-input@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Li Zefan <lizefan@huawei.com>,
"zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
Subject: [PATCH 3/3] driver: input: twl6040-vibra: fix missing of_node_put
Date: Sat, 31 Aug 2013 14:45:05 +0800 [thread overview]
Message-ID: <522190F1.3010103@huawei.com> (raw)
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
WARNING: multiple messages have this Message-ID (diff)
From: Libo Chen <clbchenlibo.chen@huawei.com>
To: <dmitry.torokhov@gmail.com>
Cc: Bill Pemberton <wfp5p@virginia.edu>, <peter.ujfalusi@ti.com>,
<broonie@opensource.wolfsonmicro.com>, <javier@dowhile0.org>,
<linux-input@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Li Zefan <lizefan@huawei.com>,
"zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
Subject: [PATCH 3/3] driver: input: twl6040-vibra: fix missing of_node_put
Date: Sat, 31 Aug 2013 14:45:05 +0800 [thread overview]
Message-ID: <522190F1.3010103@huawei.com> (raw)
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
next reply other threads:[~2013-08-31 6:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-31 6:45 Libo Chen [this message]
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
2013-09-01 16:59 ` Peter Ujfalusi
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=522190F1.3010103@huawei.com \
--to=clbchenlibo.chen@huawei.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dmitry.torokhov@gmail.com \
--cc=javier@dowhile0.org \
--cc=jovi.zhangwei@huawei.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=peter.ujfalusi@ti.com \
--cc=wfp5p@virginia.edu \
/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.