clk: sprd: sc9860: Simplify with of_device_get_match_data()

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>
[sboyd@kernel.org: Use device_get_match_data() instead, drop
printk noise]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
Krzysztof Kozlowski
2025-11-06 18:06:08 +01:00
committed by Stephen Boyd
parent 3a86608788
commit 79d022dcad

View File

@@ -2021,17 +2021,13 @@ 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 = device_get_match_data(&pdev->dev);
if (!desc)
return -ENODEV;
}
desc = match->data;
ret = sprd_clk_regmap_init(pdev, desc);
if (ret)
return ret;