From: Wei Yongjun <weiyj.lk@gmail.com>
To: Andy Gross <andy.gross@linaro.org>,
David Brown <david.brown@linaro.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org
Subject: [PATCH -next] firmware: qcom: scm: Use devm_reset_controller_register()
Date: Sun, 28 Aug 2016 16:29:10 +0000 [thread overview]
Message-ID: <1472401750-5343-1-git-send-email-weiyj.lk@gmail.com> (raw)
From: Wei Yongjun <weiyongjun1@huawei.com>
Use devm_reset_controller_register() for the reset controller
registration and fixes the memory leak when unload the module.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/firmware/qcom_scm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
index d95c702..9bf66ae 100644
--- a/drivers/firmware/qcom_scm.c
+++ b/drivers/firmware/qcom_scm.c
@@ -356,7 +356,9 @@ static int qcom_scm_probe(struct platform_device *pdev)
scm->reset.ops = &qcom_scm_pas_reset_ops;
scm->reset.nr_resets = 1;
scm->reset.of_node = pdev->dev.of_node;
- reset_controller_register(&scm->reset);
+ ret = devm_reset_controller_register(&pdev->dev, &scm->reset);
+ if (ret)
+ return ret;
/* vote for max clk rate for highest performance */
ret = clk_set_rate(scm->core_clk, INT_MAX);
next reply other threads:[~2016-08-28 16:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-28 16:29 Wei Yongjun [this message]
2016-10-24 21:37 ` [PATCH -next] firmware: qcom: scm: Use devm_reset_controller_register() Andy Gross
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=1472401750-5343-1-git-send-email-weiyj.lk@gmail.com \
--to=weiyj.lk@gmail.com \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=david.brown@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=weiyongjun1@huawei.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 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).