]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
clk: sprd: sc9860: Simplify with of_device_get_match_data()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 6 Nov 2025 17:06:08 +0000 (18:06 +0100)
committerStephen Boyd <sboyd@kernel.org>
Tue, 11 Nov 2025 01:02:12 +0000 (17:02 -0800)
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>
drivers/clk/sprd/sc9860-clk.c

index cc5ed2dd82670380868b11c4df95569a33edc732..d7fe924fbe9717c7960410b0e0fc244e859bd6c3 100644 (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;