From: Limeng <meng...@windriver.com>

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 <meng...@windriver.com>
---
 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 13e66297b65f..f788b826e4aa 100644
--- a/drivers/net/can/rcar/rcar_can.c
+++ b/drivers/net/can/rcar/rcar_can.c
@@ -15,6 +15,7 @@
 #include <linux/can/led.h>
 #include <linux/can/dev.h>
 #include <linux/clk.h>
+#include <linux/clk-provider.h>
 #include <linux/can/platform/rcar_can.h>
 #include <linux/of.h>
 
@@ -864,7 +865,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

Reply via email to