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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9a3ad0aeff409a35cfb6e398a9235de31a8d70e5.1690885413.git.matthias.schiffer@ew.tq-group.com>
Date:   Tue,  1 Aug 2023 12:36:08 +0200
From:   Matthias Schiffer <matthias.schiffer@...tq-group.com>
To:     Santosh Shilimkar <ssantosh@...nel.org>,
        Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>
Cc:     Jai Luthra <j-luthra@...com>, linux-kernel@...r.kernel.org,
        linux-clk@...r.kernel.org, linux@...tq-group.com,
        Matthias Schiffer <matthias.schiffer@...tq-group.com>
Subject: [PATCH 2/3] clk: keystone: syscon-clk: specify whether a parent is required in match data

Avoid checking the compatible string again in the probe function.

No functional change intended.

Fixes: 6acab96ee337 ("clk: keystone: syscon-clk: Add support for audio refclk")
Signed-off-by: Matthias Schiffer <matthias.schiffer@...tq-group.com>
---
 drivers/clk/keystone/syscon-clk.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/keystone/syscon-clk.c b/drivers/clk/keystone/syscon-clk.c
index 68ac536f564e..9626a877e072 100644
--- a/drivers/clk/keystone/syscon-clk.c
+++ b/drivers/clk/keystone/syscon-clk.c
@@ -27,6 +27,7 @@ struct ti_syscon_gate_clk_entry {
 struct ti_syscon_gate_clk_data {
 	const struct ti_syscon_gate_clk_entry *clks;
 	size_t num_clks;
+	bool needs_parent;
 };
 
 static struct
@@ -129,11 +130,9 @@ static int ti_syscon_gate_clk_probe(struct platform_device *pdev)
 				     "failed to get regmap\n");
 
 	num_parents = of_clk_get_parent_count(dev->of_node);
-	if (of_device_is_compatible(dev->of_node, "ti,am62-audio-refclk") &&
-	    num_parents == 0) {
+	if (data->needs_parent && num_parents == 0)
 		return dev_err_probe(dev, -EINVAL,
 				     "must specify a parent clock\n");
-	}
 
 	hw_data = devm_kzalloc(dev, struct_size(hw_data, hws, data->num_clks),
 			       GFP_KERNEL);
@@ -208,6 +207,7 @@ static const struct ti_syscon_gate_clk_entry am62_audio_clks[] = {
 static const struct ti_syscon_gate_clk_data am62_audio_clk_data = {
 	.clks = am62_audio_clks,
 	.num_clks = ARRAY_SIZE(am62_audio_clks),
+	.needs_parent = true,
 };
 
 static const struct of_device_id ti_syscon_gate_clk_ids[] = {
-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ