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  linux-cve-announce  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, 10 May 2024 15:10:25 +0530
From: Anand Moon <linux.amoon@...il.com>
To: Chanwoo Choi <cw00.choi@...sung.com>,
	MyungJoo Ham <myungjoo.ham@...sung.com>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Krzysztof Kozlowski <krzk@...nel.org>,
	Alim Akhtar <alim.akhtar@...sung.com>
Cc: Anand Moon <linux.amoon@...il.com>,
	Christophe JAILLET <christophe.jaillet@...adoo.fr>,
	linux-pm@...r.kernel.org,
	linux-samsung-soc@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH v5 2/2] PM / devfreq: exynos: Use local clk variable instead of exynos_bus member

This commit modifies the exynos bus driver to use a local clk variable
for clock handling instead of storing it in the exynos_bus struct member.
This helps in simplifying the code and makes it more readable.

Suggested-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Signed-off-by: Anand Moon <linux.amoon@...il.com>
---
v5: New patch
---
 drivers/devfreq/exynos-bus.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 7d06c476d8e9..e55ae59a8ae7 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -34,7 +34,6 @@ struct exynos_bus {
 	unsigned long curr_freq;
 
 	int opp_token;
-	struct clk *clk;
 	unsigned int ratio;
 };
 
@@ -241,13 +240,14 @@ static int exynos_bus_parse_of(struct device_node *np,
 {
 	struct device *dev = bus->dev;
 	struct dev_pm_opp *opp;
+	struct clk *clk;
 	unsigned long rate;
 	int ret;
 
 	/* Get the clock to provide each bus with source clock */
-	bus->clk = devm_clk_get_enabled(dev, "bus");
-	if (IS_ERR(bus->clk))
-		return dev_err_probe(dev, PTR_ERR(bus->clk),
+	clk = devm_clk_get_enabled(dev, "bus");
+	if (IS_ERR(clk))
+		return dev_err_probe(dev, PTR_ERR(clk),
 				"failed to get bus clock\n");
 
 	/* Get the freq and voltage from OPP table to scale the bus freq */
@@ -257,7 +257,7 @@ static int exynos_bus_parse_of(struct device_node *np,
 		return ret;
 	}
 
-	rate = clk_get_rate(bus->clk);
+	rate = clk_get_rate(clk);
 
 	opp = devfreq_recommended_opp(dev, &rate, 0);
 	if (IS_ERR(opp)) {
-- 
2.44.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ