From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Mon, 3 Aug 2020 11:30:46 +0800 Subject: [PATCH 1/1] timer: dw-apb: fix compiler warnings In-Reply-To: <20200728170208.123250-1-xypron.glpk@gmx.de> References: <20200728170208.123250-1-xypron.glpk@gmx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Jul 29, 2020 at 1:02 AM Heinrich Schuchardt 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 > --- > 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 > > #include > -#include > > #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