Skip to content

Commit 9f56539

Browse files
Minghao Chi (CGEL ZTE)mmind
authored andcommitted
clk/rockchip: Use of_device_get_match_data()
Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220221020103.1925026-1-chi.minghao@zte.com.cn Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent 6e69052 commit 9f56539

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/rockchip/clk-rk3568.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,14 +1703,12 @@ static const struct of_device_id clk_rk3568_match_table[] = {
17031703
static int __init clk_rk3568_probe(struct platform_device *pdev)
17041704
{
17051705
struct device_node *np = pdev->dev.of_node;
1706-
const struct of_device_id *match;
17071706
const struct clk_rk3568_inits *init_data;
17081707

1709-
match = of_match_device(clk_rk3568_match_table, &pdev->dev);
1710-
if (!match || !match->data)
1708+
init_data = (struct clk_rk3568_inits *)of_device_get_match_data(&pdev->dev);
1709+
if (!init_data)
17111710
return -EINVAL;
17121711

1713-
init_data = match->data;
17141712
if (init_data->inits)
17151713
init_data->inits(np);
17161714

0 commit comments

Comments
 (0)