public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bus: imx-weim: support compile test
@ 2024-08-23 10:22 Wu Bo
  2024-08-23 10:22 ` [PATCH 2/2] bus: imx-weim: change to use devm_clk_get_enabled() helpers Wu Bo
  0 siblings, 1 reply; 3+ messages in thread
From: Wu Bo @ 2024-08-23 10:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, imx,
	linux-arm-kernel, Wu Bo

Add COMPILE_TEST to support code compile test

Signed-off-by: Wu Bo <bo.wu@vivo.com>
---
 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.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] bus: imx-weim: change to use devm_clk_get_enabled() helpers
  2024-08-23 10:22 [PATCH 1/2] bus: imx-weim: support compile test Wu Bo
@ 2024-08-23 10:22 ` Wu Bo
  2024-08-23 12:12   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Wu Bo @ 2024-08-23 10:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, imx,
	linux-arm-kernel, Wu Bo

Make the code cleaner and avoid call clk_disable_unprepare()

Signed-off-by: Wu Bo <bo.wu@vivo.com>
---
 drivers/bus/imx-weim.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
index 837bf9d51c6e..81483461b514 100644
--- a/drivers/bus/imx-weim.c
+++ b/drivers/bus/imx-weim.c
@@ -282,19 +282,13 @@ 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
+	if (!ret)
 		dev_info(&pdev->dev, "Driver registered.\n");
 
 	return ret;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] bus: imx-weim: change to use devm_clk_get_enabled() helpers
  2024-08-23 10:22 ` [PATCH 2/2] bus: imx-weim: change to use devm_clk_get_enabled() helpers Wu Bo
@ 2024-08-23 12:12   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2024-08-23 12:12 UTC (permalink / raw)
  To: Wu Bo
  Cc: linux-kernel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	imx, linux-arm-kernel

On Fri, 23 Aug 2024 04:22:11 -0600
Wu Bo <bo.wu@vivo.com> wrote:

> Make the code cleaner and avoid call clk_disable_unprepare()
> 
> Signed-off-by: Wu Bo <bo.wu@vivo.com>
> ---
>  drivers/bus/imx-weim.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
> index 837bf9d51c6e..81483461b514 100644
> --- a/drivers/bus/imx-weim.c
> +++ b/drivers/bus/imx-weim.c
> @@ -282,19 +282,13 @@ 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)
	if (ret)
		return ret;

	dev_info()

	return 0;


> -		clk_disable_unprepare(clk);
> -	else
> +	if (!ret)
>  		dev_info(&pdev->dev, "Driver registered.\n");
>  
>  	return ret;


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-23 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 10:22 [PATCH 1/2] bus: imx-weim: support compile test Wu Bo
2024-08-23 10:22 ` [PATCH 2/2] bus: imx-weim: change to use devm_clk_get_enabled() helpers Wu Bo
2024-08-23 12:12   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox