[PATCH] clk/rockchip: Use of_device_get_match_data()

cgel.zte@gmail.com posted 1 patch 4 years, 4 months ago
There is a newer version of this series
drivers/clk/rockchip/clk-rk3568.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH] clk/rockchip: Use of_device_get_match_data()
Posted by cgel.zte@gmail.com 4 years, 4 months ago
From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>

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>
---
 drivers/clk/rockchip/clk-rk3568.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/rockchip/clk-rk3568.c b/drivers/clk/rockchip/clk-rk3568.c
index 69a9e8069a48..9ca1a26a2533 100644
--- a/drivers/clk/rockchip/clk-rk3568.c
+++ b/drivers/clk/rockchip/clk-rk3568.c
@@ -1697,14 +1697,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);
 
-- 
2.25.1

Re: [PATCH] clk/rockchip: Use of_device_get_match_data()
Posted by Heiko Stuebner 4 years, 4 months ago
On Mon, 21 Feb 2022 02:01:03 +0000, cgel.zte@gmail.com wrote:
> Use of_device_get_match_data() to simplify the code.

Applied, thanks!

[1/1] clk/rockchip: Use of_device_get_match_data()
      commit: 9f565399ad0739dbdeac868e40e86e80f54dc77b

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>