Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / cpu / armv7 / bcm281xx / clk-core.c
index d4425835a1b34720f2d464ce4c98eacd6be7a200..26b673a5405e26e7e8d04d5ef954edf41df1d8e3 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2013 Broadcom Corporation.
- *
- * SPDX-License-Identifier:      GPL-2.0+
  */
 
 /*
  */
 
 #include <common.h>
+#include <log.h>
 #include <asm/io.h>
-#include <asm/errno.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
 #include <bitfield.h>
 #include <asm/arch/sysmap.h>
 #include <asm/kona-common/clk.h>
@@ -479,9 +480,9 @@ unsigned long clk_get_rate(struct clk *c)
 {
        unsigned long rate;
 
-       debug("%s: %s\n", __func__, c->name);
        if (!c || !c->ops || !c->ops->get_rate)
                return 0;
+       debug("%s: %s\n", __func__, c->name);
 
        rate = c->ops->get_rate(c);
        debug("%s: rate = %ld\n", __func__, rate);
@@ -493,9 +494,9 @@ int clk_set_rate(struct clk *c, unsigned long rate)
 {
        int ret;
 
-       debug("%s: %s rate=%ld\n", __func__, c->name, rate);
        if (!c || !c->ops || !c->ops->set_rate)
                return -EINVAL;
+       debug("%s: %s rate=%ld\n", __func__, c->name, rate);
 
        if (c->use_cnt)
                return -EINVAL;