diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-15 08:11:06 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-03-27 05:04:31 +0300 |
commit | 539db6ab09c06ff052dac6c585ec1eaf3f1d6dc8 (patch) | |
tree | fa4e2a8efbd249c0d6ad3d31b89698519ab3c354 | |
parent | 70f5c99d607d8687d4e537c388af82bb194f2ef9 (diff) | |
download | u-boot-539db6ab09c06ff052dac6c585ec1eaf3f1d6dc8.tar.xz |
sandbox: Only call timer_timebase_fallback() if present
This function only exists if CPU is enabled. Update the code to take
account of this, so that it does not have to be enabled on all sandbox
builds.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
-rw-r--r-- | drivers/timer/sandbox_timer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/timer/sandbox_timer.c b/drivers/timer/sandbox_timer.c index 2075cd4edd..c846bfb9f1 100644 --- a/drivers/timer/sandbox_timer.c +++ b/drivers/timer/sandbox_timer.c @@ -38,7 +38,8 @@ static int sandbox_timer_probe(struct udevice *dev) { struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); - if (dev_read_bool(dev, "sandbox,timebase-frequency-fallback")) + if (CONFIG_IS_ENABLED(CPU) && + dev_read_bool(dev, "sandbox,timebase-frequency-fallback")) return timer_timebase_fallback(dev); else if (!uc_priv->clock_rate) uc_priv->clock_rate = SANDBOX_TIMER_RATE; |