X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Ftimer%2Fstm32_timer.c;h=215334f1b8c017438b8ef0e914c20a5659862bee;hb=720620e6916ba40b9a173bb07706d2c73f3c23e7;hp=9a856b1b5afb498a9665f27fdbf1ff781ed155cf;hpb=e8f80a5a58c9b506453cc0780687e8ed457d30a6;p=platform%2Fkernel%2Fu-boot.git diff --git a/drivers/timer/stm32_timer.c b/drivers/timer/stm32_timer.c index 9a856b1..215334f 100644 --- a/drivers/timer/stm32_timer.c +++ b/drivers/timer/stm32_timer.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2018, STMicroelectronics - All Rights Reserved - * Author(s): Patrice Chotard, for STMicroelectronics. + * Author(s): Patrice Chotard, for STMicroelectronics. */ #include @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include @@ -50,14 +52,12 @@ struct stm32_timer_priv { struct stm32_timer_regs *base; }; -static int stm32_timer_get_count(struct udevice *dev, u64 *count) +static u64 stm32_timer_get_count(struct udevice *dev) { struct stm32_timer_priv *priv = dev_get_priv(dev); struct stm32_timer_regs *regs = priv->base; - *count = readl(®s->cnt); - - return 0; + return readl(®s->cnt); } static int stm32_timer_probe(struct udevice *dev) @@ -129,9 +129,8 @@ U_BOOT_DRIVER(stm32_timer) = { .name = "stm32_timer", .id = UCLASS_TIMER, .of_match = stm32_timer_ids, - .priv_auto_alloc_size = sizeof(struct stm32_timer_priv), + .priv_auto = sizeof(struct stm32_timer_priv), .probe = stm32_timer_probe, .ops = &stm32_timer_ops, - .flags = DM_FLAG_PRE_RELOC, };