mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] clk: sprd: sc9860: Simplify with of_device_get_match_data()
@ 2025-11-06 17:06 Krzysztof Kozlowski
  2025-11-11  1:03 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-06 17:06 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Orson Zhai, Baolin Wang,
	Chunyan Zhang, linux-clk, linux-kernel
  Cc: Krzysztof Kozlowski

Driver's probe function matches against driver's of_device_id table,
where each entry has non-NULL match data, so of_match_node() can be
simplified with of_device_get_match_data().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/clk/sprd/sc9860-clk.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/sprd/sc9860-clk.c b/drivers/clk/sprd/sc9860-clk.c
index cc5ed2dd8267..c106b6422649 100644
--- a/drivers/clk/sprd/sc9860-clk.c
+++ b/drivers/clk/sprd/sc9860-clk.c
@@ -2021,17 +2021,15 @@ MODULE_DEVICE_TABLE(of, sprd_sc9860_clk_ids);
 
 static int sc9860_clk_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *match;
 	const struct sprd_clk_desc *desc;
 	int ret;
 
-	match = of_match_node(sprd_sc9860_clk_ids, pdev->dev.of_node);
-	if (!match) {
-		pr_err("%s: of_match_node() failed", __func__);
+	desc = of_device_get_match_data(&pdev->dev);
+	if (!desc) {
+		pr_err("%s: of_device_get_match_data() failed", __func__);
 		return -ENODEV;
 	}
 
-	desc = match->data;
 	ret = sprd_clk_regmap_init(pdev, desc);
 	if (ret)
 		return ret;
-- 
2.48.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] clk: sprd: sc9860: Simplify with of_device_get_match_data()
  2025-11-06 17:06 [PATCH] clk: sprd: sc9860: Simplify with of_device_get_match_data() Krzysztof Kozlowski
@ 2025-11-11  1:03 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2025-11-11  1:03 UTC (permalink / raw)
  To: Baolin Wang, Chunyan Zhang, Krzysztof Kozlowski,
	Michael Turquette, Orson Zhai, linux-clk, linux-kernel
  Cc: Krzysztof Kozlowski

Quoting Krzysztof Kozlowski (2025-11-06 09:06:08)
> Driver's probe function matches against driver's of_device_id table,
> where each entry has non-NULL match data, so of_match_node() can be
> simplified with of_device_get_match_data().
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-11  1:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-06 17:06 [PATCH] clk: sprd: sc9860: Simplify with of_device_get_match_data() Krzysztof Kozlowski
2025-11-11  1:03 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®