diff mbox series

[1/1] timer: dw-apb: fix compiler warnings

Message ID 20200728170208.123250-1-xypron.glpk@gmx.de
State Superseded, archived
Delegated to: Marek Vasut
Headers show
Series [1/1] timer: dw-apb: fix compiler warnings | expand

Commit Message

Heinrich Schuchardt July 28, 2020, 5:02 p.m. UTC
readl() and writel() expect void *. Do not pass an integer value.

Remove unused include include asm/arch/timer.h.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
The driver is needed for the timers of the Kendryte K210 (compatible
"snps,dw-apb-timer").
---
 drivers/timer/dw-apb-timer.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--
2.27.0

Comments

Bin Meng Aug. 3, 2020, 3:30 a.m. UTC | #1
On Wed, Jul 29, 2020 at 1:02 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> readl() and writel() expect void *. Do not pass an integer value.
>
> Remove unused include include asm/arch/timer.h.

two include ?

>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> The driver is needed for the timers of the Kendryte K210 (compatible
> "snps,dw-apb-timer").
> ---
>  drivers/timer/dw-apb-timer.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/timer/dw-apb-timer.c b/drivers/timer/dw-apb-timer.c
> index 35271b20c8..c8be4417fd 100644
> --- a/drivers/timer/dw-apb-timer.c
> +++ b/drivers/timer/dw-apb-timer.c
> @@ -14,7 +14,6 @@
>  #include <dm/device_compat.h>
>
>  #include <asm/io.h>
> -#include <asm/arch/timer.h>
>
>  #define DW_APB_LOAD_VAL                0x0
>  #define DW_APB_CURR_VAL                0x4
> @@ -34,7 +33,7 @@ static int dw_apb_timer_get_count(struct udevice *dev, u64 *count)
>          * requires the count to be incrementing. Invert the
>          * result.
>          */
> -       *count = timer_conv_64(~readl(priv->regs + DW_APB_CURR_VAL));
> +       *count = timer_conv_64(~readl((void *)(priv->regs + DW_APB_CURR_VAL)));
>
>         return 0;
>  }
> @@ -61,8 +60,8 @@ static int dw_apb_timer_probe(struct udevice *dev)
>         clk_free(&clk);
>
>         /* init timer */
> -       writel(0xffffffff, priv->regs + DW_APB_LOAD_VAL);
> -       writel(0xffffffff, priv->regs + DW_APB_CURR_VAL);
> +       writel(0xffffffff, (void *)(priv->regs + DW_APB_LOAD_VAL));
> +       writel(0xffffffff, (void *)(priv->regs + DW_APB_CURR_VAL));
>         setbits_le32(priv->regs + DW_APB_CTRL, 0x3);
>

Reviewed-by: Bin Meng <bin.meng@windriver.com>
diff mbox series

Patch

diff --git a/drivers/timer/dw-apb-timer.c b/drivers/timer/dw-apb-timer.c
index 35271b20c8..c8be4417fd 100644
--- a/drivers/timer/dw-apb-timer.c
+++ b/drivers/timer/dw-apb-timer.c
@@ -14,7 +14,6 @@ 
 #include <dm/device_compat.h>

 #include <asm/io.h>
-#include <asm/arch/timer.h>

 #define DW_APB_LOAD_VAL		0x0
 #define DW_APB_CURR_VAL		0x4
@@ -34,7 +33,7 @@  static int dw_apb_timer_get_count(struct udevice *dev, u64 *count)
 	 * requires the count to be incrementing. Invert the
 	 * result.
 	 */
-	*count = timer_conv_64(~readl(priv->regs + DW_APB_CURR_VAL));
+	*count = timer_conv_64(~readl((void *)(priv->regs + DW_APB_CURR_VAL)));

 	return 0;
 }
@@ -61,8 +60,8 @@  static int dw_apb_timer_probe(struct udevice *dev)
 	clk_free(&clk);

 	/* init timer */
-	writel(0xffffffff, priv->regs + DW_APB_LOAD_VAL);
-	writel(0xffffffff, priv->regs + DW_APB_CURR_VAL);
+	writel(0xffffffff, (void *)(priv->regs + DW_APB_LOAD_VAL));
+	writel(0xffffffff, (void *)(priv->regs + DW_APB_CURR_VAL));
 	setbits_le32(priv->regs + DW_APB_CTRL, 0x3);

 	return 0;