From ce6697a613c523b4e2e1d4228c0a81facc080076 Mon Sep 17 00:00:00 2001 From: Wu Bo Date: Mon, 26 Aug 2024 21:23:47 -0600 Subject: [PATCH 1/2] bus: imx-weim: support compile test Add COMPILE_TEST to support code compile test Signed-off-by: Wu Bo Signed-off-by: Shawn Guo --- drivers/bus/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index 64cd2ee03aa3..ff669a8ccad9 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -89,7 +89,7 @@ config HISILICON_LPC config IMX_WEIM bool "Freescale EIM DRIVER" - depends on ARCH_MXC + depends on ARCH_MXC || COMPILE_TEST help Driver for i.MX WEIM controller. The WEIM(Wireless External Interface Module) works like a bus. From 2ea2113b3dacf9cf616488f875f32584dad53ff8 Mon Sep 17 00:00:00 2001 From: Wu Bo Date: Mon, 26 Aug 2024 21:23:48 -0600 Subject: [PATCH 2/2] bus: imx-weim: change to use devm_clk_get_enabled() helper Make the code cleaner and avoid call clk_disable_unprepare() Signed-off-by: Wu Bo Signed-off-by: Shawn Guo --- drivers/bus/imx-weim.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index 837bf9d51c6e..83d623d97f5f 100644 --- a/drivers/bus/imx-weim.c +++ b/drivers/bus/imx-weim.c @@ -282,22 +282,18 @@ static int weim_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, priv); /* get the clock */ - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) return PTR_ERR(clk); - ret = clk_prepare_enable(clk); - if (ret) - return ret; - /* parse the device node */ ret = weim_parse_dt(pdev); if (ret) - clk_disable_unprepare(clk); - else - dev_info(&pdev->dev, "Driver registered.\n"); + return ret; - return ret; + dev_info(&pdev->dev, "Driver registered.\n"); + + return 0; } #if IS_ENABLED(CONFIG_OF_DYNAMIC)