[linux-yocto] [PATCH 2/5] driver: net: can: disable clock when it is in enable status

2019-10-24 Thread Meng.Li
From: Limeng 

If disable a clock when it is already in disable status, there
will be a warning trace generated. So, it is need to confirm
whether what status the clock is in before disable it.

Signed-off-by: Meng Li 
---
 drivers/net/can/rcar/rcar_can.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c
index bf5adea9c0a3..b136a238f7eb 100644
--- a/drivers/net/can/rcar/rcar_can.c
+++ b/drivers/net/can/rcar/rcar_can.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define RCAR_CAN_DRV_NAME  "rcar_can"
@@ -859,7 +860,9 @@ static int __maybe_unused rcar_can_suspend(struct device 
*dev)
writew(ctlr, &priv->regs->ctlr);
priv->can.state = CAN_STATE_SLEEPING;
 
-   clk_disable(priv->clk);
+   if(__clk_is_enabled(priv->clk))
+   clk_disable(priv->clk);
+
return 0;
 }
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 2/5] driver: net: can: disable clock when it is in enable status

2019-10-23 Thread Meng.Li
From: Limeng 

If disable a clock when it is already in disable status, there
will be a warning trace generated. So, it is need to confirm
whether what status the clock is in before disable it.

Signed-off-by: Meng Li 
---
 drivers/net/can/rcar/rcar_can.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c
index bf5adea9c0a3..b136a238f7eb 100644
--- a/drivers/net/can/rcar/rcar_can.c
+++ b/drivers/net/can/rcar/rcar_can.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define RCAR_CAN_DRV_NAME  "rcar_can"
@@ -859,7 +860,9 @@ static int __maybe_unused rcar_can_suspend(struct device 
*dev)
writew(ctlr, &priv->regs->ctlr);
priv->can.state = CAN_STATE_SLEEPING;
 
-   clk_disable(priv->clk);
+   if(__clk_is_enabled(priv->clk))
+   clk_disable(priv->clk);
+
return 0;
 }
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto