From 190db3b49f06b555b2d320d934e51da5d5c4fe92 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Thu, 15 Dec 2022 14:18:55 +0800 Subject: [PATCH] clk: rockchip: px30: allow insmod to succeed if no DT match Signed-off-by: Tao Huang Change-Id: I2625679beff77d3eabe9d50b94d232eca500cfaf --- drivers/clk/rockchip/clk-px30.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/clk/rockchip/clk-px30.c b/drivers/clk/rockchip/clk-px30.c index 43cc084f369f..3294ce8eaf32 100644 --- a/drivers/clk/rockchip/clk-px30.c +++ b/drivers/clk/rockchip/clk-px30.c @@ -1097,6 +1097,7 @@ static void __init px30_pmu_clk_init(struct device_node *np) } CLK_OF_DECLARE(px30_cru_pmu, "rockchip,px30-pmucru", px30_pmu_clk_init); +#ifdef MODULE struct clk_px30_inits { void (*inits)(struct device_node *np); }; @@ -1121,7 +1122,7 @@ static const struct of_device_id clk_px30_match_table[] = { }; MODULE_DEVICE_TABLE(of, clk_px30_match_table); -static int __init clk_px30_probe(struct platform_device *pdev) +static int clk_px30_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; const struct of_device_id *match; @@ -1139,12 +1140,14 @@ static int __init clk_px30_probe(struct platform_device *pdev) } static struct platform_driver clk_px30_driver = { + .probe = clk_px30_probe, .driver = { .name = "clk-px30", .of_match_table = clk_px30_match_table, }, }; -builtin_platform_driver_probe(clk_px30_driver, clk_px30_probe); +module_platform_driver(clk_px30_driver); MODULE_DESCRIPTION("Rockchip PX30 Clock Driver"); MODULE_LICENSE("GPL"); +#endif /* MODULE */