From: Lokesh Vutla Date: Thu, 16 Aug 2018 18:26:55 +0530 Subject: [U-Boot] [PATCH 4/4] dm: omap-timer: Update clock rate only if not populated In-Reply-To: <20180816125655.16644-1-lokeshvutla@ti.com> References: <20180816125655.16644-1-lokeshvutla@ti.com> Message-ID: <20180816125655.16644-5-lokeshvutla@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de timer_pre_probe() tries to populate the clock rate from DT. omap timer driver tries to overwrite this value irrespective of the value populated fro DT. So update this value only when DT doesn't populate the clock rate. Signed-off-by: Lokesh Vutla --- drivers/timer/omap-timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/timer/omap-timer.c b/drivers/timer/omap-timer.c index b8f52ef2e4..59154b5158 100644 --- a/drivers/timer/omap-timer.c +++ b/drivers/timer/omap-timer.c @@ -60,7 +60,8 @@ static int omap_timer_probe(struct udevice *dev) struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); struct omap_timer_priv *priv = dev_get_priv(dev); - uc_priv->clock_rate = TIMER_CLOCK; + if (!uc_priv->clock_rate) + uc_priv->clock_rate = TIMER_CLOCK; /* start the counter ticking up, reload value on overflow */ writel(0, &priv->regs->tldr); -- 2.18.0