Skip to content

Commit

Permalink
clk/rockchip: Use of_device_get_match_data()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Minghao Chi (CGEL ZTE) authored and Heiko Stuebner committed Feb 23, 2022
1 parent 6e69052 commit 9f56539
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/clk/rockchip/clk-rk3568.c
Original file line number Diff line number Diff line change
Expand Up @@ -1703,14 +1703,12 @@ static const struct of_device_id clk_rk3568_match_table[] = {
static int __init clk_rk3568_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
const struct of_device_id *match;
const struct clk_rk3568_inits *init_data;

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

init_data = match->data;
if (init_data->inits)
init_data->inits(np);

Expand Down

0 comments on commit 9f56539

Please sign in to comment.