From: Anand Moon <linux.amoon@gmail.com>
To: Chanwoo Choi <cw00.choi@samsung.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Alim Akhtar <alim.akhtar@samsung.com>
Cc: Anand Moon <linux.amoon@gmail.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v5 2/2] PM / devfreq: exynos: Use local clk variable instead of exynos_bus member
Date: Fri, 10 May 2024 15:10:25 +0530 [thread overview]
Message-ID: <20240510094034.12493-2-linux.amoon@gmail.com> (raw)
In-Reply-To: <20240510094034.12493-1-linux.amoon@gmail.com>
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@wanadoo.fr>
Signed-off-by: Anand Moon <linux.amoon@gmail.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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2024-05-10 9:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-10 9:40 [PATCH v5 1/2] PM / devfreq: exynos: Use Use devm_clk_get_enabled() helpers Anand Moon
2024-05-10 9:40 ` Anand Moon [this message]
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=20240510094034.12493-2-linux.amoon@gmail.com \
--to=linux.amoon@gmail.com \
--cc=alim.akhtar@samsung.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=cw00.choi@samsung.com \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=myungjoo.ham@samsung.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 read-only IMAP folder(s) and NNTP newsgroup(s).