Skip to content

Commit 79d022d

Browse files
krzkbebarino
authored andcommitted
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>
1 parent 3a86608 commit 79d022d

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

drivers/clk/sprd/sc9860-clk.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,17 +2021,13 @@ MODULE_DEVICE_TABLE(of, sprd_sc9860_clk_ids);
20212021

20222022
static int sc9860_clk_probe(struct platform_device *pdev)
20232023
{
2024-
const struct of_device_id *match;
20252024
const struct sprd_clk_desc *desc;
20262025
int ret;
20272026

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)
20312029
return -ENODEV;
2032-
}
20332030

2034-
desc = match->data;
20352031
ret = sprd_clk_regmap_init(pdev, desc);
20362032
if (ret)
20372033
return ret;

0 commit comments

Comments
 (0)