Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Krzysztof Kozlowski and committed by
Stephen Boyd
79d022dc 3a866087

+2 -6
+2 -6
drivers/clk/sprd/sc9860-clk.c
··· 2021 2021 2022 2022 static int sc9860_clk_probe(struct platform_device *pdev) 2023 2023 { 2024 - const struct of_device_id *match; 2025 2024 const struct sprd_clk_desc *desc; 2026 2025 int ret; 2027 2026 2028 - match = of_match_node(sprd_sc9860_clk_ids, pdev->dev.of_node); 2029 - if (!match) { 2030 - pr_err("%s: of_match_node() failed", __func__); 2027 + desc = device_get_match_data(&pdev->dev); 2028 + if (!desc) 2031 2029 return -ENODEV; 2032 - } 2033 2030 2034 - desc = match->data; 2035 2031 ret = sprd_clk_regmap_init(pdev, desc); 2036 2032 if (ret) 2037 2033 return ret;