diff options
author | Anthony Zhou <anzhou@nvidia.com> | 2017-04-27 22:00:54 +0800 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2017-06-14 17:01:51 -0700 |
commit | 3436089d6725e74c836ae6c1f5367eeedc051f48 (patch) | |
tree | cbc273561508da09a60ac4319de88e5f9d7e4a2f /plat/nvidia | |
parent | 9a8f05e47d00efa2f1eac07fe4373de464b5b11c (diff) |
Tegra: delay_timer: fix MISRA defects
Main fixes:
* Include header file for function declarations [Rule 8.4]
* Move global object into function [Rule 8.9]
Change-Id: I1bc9f3f0ebd4ffc0b8444ac856cd97b0cb56bda4
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
Diffstat (limited to 'plat/nvidia')
-rw-r--r-- | plat/nvidia/tegra/common/tegra_delay_timer.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/plat/nvidia/tegra/common/tegra_delay_timer.c b/plat/nvidia/tegra/common/tegra_delay_timer.c index 56c98516..3bd2b0e2 100644 --- a/plat/nvidia/tegra/common/tegra_delay_timer.c +++ b/plat/nvidia/tegra/common/tegra_delay_timer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -7,23 +7,24 @@ #include <delay_timer.h> #include <mmio.h> #include <tegra_def.h> +#include <tegra_private.h> static uint32_t tegra_timerus_get_value(void) { return mmio_read_32(TEGRA_TMRUS_BASE); } -static const timer_ops_t tegra_timer_ops = { - .get_timer_value = tegra_timerus_get_value, - .clk_mult = 1, - .clk_div = 1, -}; - /* * Initialise the on-chip free rolling us counter as the delay * timer. */ void tegra_delay_timer_init(void) { + static const timer_ops_t tegra_timer_ops = { + .get_timer_value = tegra_timerus_get_value, + .clk_mult = 1, + .clk_div = 1, + }; + timer_init(&tegra_timer_ops); } |