lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri,  1 Jan 2021 16:54:57 +0000
From:   Yangtao Li <tiny.windzz@...il.com>
To:     myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
        cw00.choi@...sung.com, krzk@...nel.org, shawnguo@...nel.org,
        s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
        linux-imx@....com, digetx@...il.com, thierry.reding@...il.com,
        jonathanh@...dia.com, yuq825@...il.com, airlied@...ux.ie,
        daniel@...ll.ch, robdclark@...il.com, sean@...rly.run,
        robh@...nel.org, tomeu.vizoso@...labora.com, steven.price@....com,
        alyssa.rosenzweig@...labora.com, stanimir.varbanov@...aro.org,
        agross@...nel.org, bjorn.andersson@...aro.org, mchehab@...nel.org,
        lukasz.luba@....com, adrian.hunter@...el.com,
        ulf.hansson@...aro.org, vireshk@...nel.org, nm@...com,
        sboyd@...nel.org, broonie@...nel.org, gregkh@...uxfoundation.org,
        jirislaby@...nel.org, rjw@...ysocki.net, jcrouse@...eaurora.org,
        hoegsberg@...gle.com, eric@...olt.net, tzimmermann@...e.de,
        marijn.suijten@...ainline.org, gustavoars@...nel.org,
        emil.velikov@...labora.com, jonathan@...ek.ca,
        akhilpo@...eaurora.org, smasetty@...eaurora.org,
        airlied@...hat.com, masneyb@...tation.org, kalyan_t@...eaurora.org,
        tanmay@...eaurora.org, tiny.windzz@...il.com,
        ddavenport@...omium.org, jsanka@...eaurora.org,
        rnayak@...eaurora.org, tongtiangen@...wei.com,
        miaoqinglang@...wei.com, khsieh@...eaurora.org,
        abhinavk@...eaurora.org, chandanu@...eaurora.org,
        groeck@...omium.org, varar@...eaurora.org, mka@...omium.org,
        harigovi@...eaurora.org, rikard.falkeborn@...il.com,
        natechancellor@...il.com, georgi.djakov@...aro.org,
        akashast@...eaurora.org, parashar@...eaurora.org,
        dianders@...omium.org
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-samsung-soc@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-tegra@...r.kernel.org,
        dri-devel@...ts.freedesktop.org, lima@...ts.freedesktop.org,
        linux-arm-msm@...r.kernel.org, freedreno@...ts.freedesktop.org,
        linux-media@...r.kernel.org, linux-mmc@...r.kernel.org,
        linux-spi@...r.kernel.org, linux-serial@...r.kernel.org
Subject: [PATCH 21/31] media: venus: convert to use devm_pm_opp_* API

Use devm_pm_opp_* API to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
 .../media/platform/qcom/venus/pm_helpers.c    | 21 ++++---------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 59cbd6c39450..9684c25558ef 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -871,31 +871,23 @@ static int core_get_v4(struct device *dev)
 	if (legacy_binding)
 		return 0;
 
-	core->opp_table = dev_pm_opp_set_clkname(dev, "core");
+	core->opp_table = devm_pm_opp_set_clkname(dev, "core");
 	if (IS_ERR(core->opp_table))
 		return PTR_ERR(core->opp_table);
 
 	if (core->res->opp_pmdomain) {
-		ret = dev_pm_opp_of_add_table(dev);
+		ret = devm_pm_opp_of_add_table(dev);
 		if (!ret) {
 			core->has_opp_table = true;
 		} else if (ret != -ENODEV) {
 			dev_err(dev, "invalid OPP table in device tree\n");
 			return ret;
 		} else {
-			dev_pm_opp_put_clkname(core->opp_table);
+			devm_pm_opp_put_clkname(dev, core->opp_table);
 		}
 	}
 
-	ret = vcodec_domains_get(dev);
-	if (ret) {
-		if (core->has_opp_table)
-			dev_pm_opp_of_remove_table(dev);
-		dev_pm_opp_put_clkname(core->opp_table);
-		return ret;
-	}
-
-	return 0;
+	return vcodec_domains_get(dev);
 }
 
 static void core_put_v4(struct device *dev)
@@ -906,11 +898,6 @@ static void core_put_v4(struct device *dev)
 		return;
 
 	vcodec_domains_put(dev);
-
-	if (core->has_opp_table)
-		dev_pm_opp_of_remove_table(dev);
-	dev_pm_opp_put_clkname(core->opp_table);
-
 }
 
 static int core_power_v4(struct device *dev, int on)
-- 
2.25.1

Powered by blists - more mailing lists