All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] timer: dw-apb: fix compiler warnings
@ 2020-07-28 17:02 Heinrich Schuchardt
  2020-08-03  3:30 ` Bin Meng
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2020-07-28 17:02 UTC (permalink / raw)
  To: u-boot

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(-)

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;
--
2.27.0

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

* [PATCH 1/1] timer: dw-apb: fix compiler warnings
  2020-07-28 17:02 [PATCH 1/1] timer: dw-apb: fix compiler warnings Heinrich Schuchardt
@ 2020-08-03  3:30 ` Bin Meng
  0 siblings, 0 replies; 2+ messages in thread
From: Bin Meng @ 2020-08-03  3:30 UTC (permalink / raw)
  To: u-boot

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>

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

end of thread, other threads:[~2020-08-03  3:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28 17:02 [PATCH 1/1] timer: dw-apb: fix compiler warnings Heinrich Schuchardt
2020-08-03  3:30 ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.