From: Gregory CLEMENT <gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: "Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>,
Viresh Kumar
<viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: "Jason Cooper" <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
"Andrew Lunn" <andrew-g2DYL2Zd6BY@public.gmane.org>,
"Sebastian Hesselbarth"
<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Gregory CLEMENT"
<gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Thomas Petazzoni"
<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
"Antoine Tenart"
<antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
"Miquèl Raynal"
<miquel.raynal-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
"Nadav Haklai" <nadavh-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
"Victor Gu" <xigu-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
"Marcin Wojtas" <mw-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>,
"Wilson Ding" <dingwei-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
"Hua Jing" <jinghua-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
"Neta Zur Hershkovits"
<neta-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
"Evan Wang" <xswang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
"Andre Heider" <a.heider-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v2 4/7] cpufreq: mvebu: Use dev_pm_opp_remove()
Date: Thu, 7 Dec 2017 14:56:13 +0100 [thread overview]
Message-ID: <20171207135616.23670-5-gregory.clement@free-electrons.com> (raw)
In-Reply-To: <20171207135616.23670-1-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Since the introduction of this driver, the dev_pm_opp_remove() was
added. So stop claiming we can't remove opp and use it in case of
failure.
Signed-off-by: Gregory CLEMENT <gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/cpufreq/mvebu-cpufreq.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/cpufreq/mvebu-cpufreq.c b/drivers/cpufreq/mvebu-cpufreq.c
index ed915ee85dd9..419c2b01a44c 100644
--- a/drivers/cpufreq/mvebu-cpufreq.c
+++ b/drivers/cpufreq/mvebu-cpufreq.c
@@ -76,12 +76,6 @@ static int __init armada_xp_pmsu_cpufreq_init(void)
return PTR_ERR(clk);
}
- /*
- * In case of a failure of dev_pm_opp_add(), we don't
- * bother with cleaning up the registered OPP (there's
- * no function to do so), and simply cancel the
- * registration of the cpufreq device.
- */
ret = dev_pm_opp_add(cpu_dev, clk_get_rate(clk), 0);
if (ret) {
clk_put(clk);
@@ -90,6 +84,11 @@ static int __init armada_xp_pmsu_cpufreq_init(void)
ret = dev_pm_opp_add(cpu_dev, clk_get_rate(clk) / 2, 0);
if (ret) {
+ /*
+ * The second opp failed to be added, remove
+ * the first one before exiting.
+ */
+ dev_pm_opp_remove(cpu_dev, clk_get_rate(clk));
clk_put(clk);
return ret;
}
--
2.15.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-12-07 13:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 13:56 [PATCH v2 0/7] Add CPU Frequency scaling support on Armada 37xx Gregory CLEMENT
2017-12-07 13:56 ` [PATCH v2 1/7] dt-bindings: marvell: Add documentation for the North Bridge PM " Gregory CLEMENT
[not found] ` <20171207135616.23670-2-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-12-07 23:36 ` Rob Herring
2017-12-07 13:56 ` [PATCH v2 7/7] arm64: dts: marvell: armada-37xx: add nodes allowing cpufreq support Gregory CLEMENT
[not found] ` <20171207135616.23670-1-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-12-07 13:56 ` [PATCH v2 2/7] cpufreq: ARM: sort the Kconfig menu Gregory CLEMENT
2017-12-12 6:56 ` Viresh Kumar
2017-12-07 13:56 ` [PATCH v2 3/7] cpufreq: sort the drivers in ARM part Gregory CLEMENT
[not found] ` <20171207135616.23670-4-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-12-12 6:57 ` Viresh Kumar
2017-12-07 13:56 ` Gregory CLEMENT [this message]
[not found] ` <20171207135616.23670-5-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-12-12 7:21 ` [PATCH v2 4/7] cpufreq: mvebu: Use dev_pm_opp_remove() Viresh Kumar
2017-12-12 7:28 ` Thomas Petazzoni
[not found] ` <20171212082846.4e201953-dFHcqWZE4newlwMtHBQNBj9sBOhXbXn6VpNB7YpNyf8@public.gmane.org>
2017-12-12 7:33 ` Viresh Kumar
2017-12-07 13:56 ` [PATCH v2 5/7] MAINTAINERS: add new entries for Armada 37xx cpufreq driver Gregory CLEMENT
2017-12-12 7:22 ` Viresh Kumar
2017-12-07 13:56 ` [PATCH v2 6/7] cpufreq: Add DVFS support for Armada 37xx Gregory CLEMENT
[not found] ` <20171207135616.23670-7-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-12-12 7:24 ` Viresh Kumar
2017-12-13 16:45 ` Gregory CLEMENT
2017-12-07 17:14 ` [PATCH v2 0/7] Add CPU Frequency scaling support on " Rafael J. Wysocki
2017-12-07 17:58 ` Gregory CLEMENT
2017-12-07 21:19 ` Rafael J. Wysocki
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=20171207135616.23670-5-gregory.clement@free-electrons.com \
--to=gregory.clement-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=a.heider-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=andrew-g2DYL2Zd6BY@public.gmane.org \
--cc=antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dingwei-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
--cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
--cc=jinghua-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=miquel.raynal-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=mw-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org \
--cc=nadavh-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
--cc=neta-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
--cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=xigu-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
--cc=xswang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
/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).