summaryrefslogtreecommitdiff
path: root/arch/sparc
diff options
context:
space:
mode:
authorPavel Tatashin <pasha.tatashin@oracle.com>2017-06-15 17:40:58 +0300
committerDavid S. Miller <davem@davemloft.net>2017-06-15 18:19:34 +0300
commitfca4afe400cb68fe5a7f0a97fb1ba5cfdcb81675 (patch)
tree976f7baa3c9cfb53dd360d58f6a30bd1f5da9e72 /arch/sparc
parent9300d9c4ad29b0e79c55c0ba7a16cfc4c13442b8 (diff)
downloadlinux-fca4afe400cb68fe5a7f0a97fb1ba5cfdcb81675.tar.xz
sparc64: use prom interface to get %stick frequency
We initialize time early, we must use prom interface instead of open firmware driver, which is not yet initialized. Also, use prom_getintdefault() instead of prom_getint() to be compatible with the code before early boot timestamps project. Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/time_64.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index a612a91cb9cd..a62758ce9e19 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -32,7 +32,6 @@
#include <linux/kernel_stat.h>
#include <linux/clockchips.h>
#include <linux/clocksource.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/ftrace.h>
@@ -257,7 +256,7 @@ static int stick_add_compare(unsigned long adj)
static unsigned long stick_get_frequency(void)
{
- return prom_getint(prom_root_node, "stick-frequency");
+ return prom_getintdefault(prom_root_node, "stick-frequency", 0);
}
static struct sparc64_tick_ops stick_operations __read_mostly = {
@@ -391,9 +390,7 @@ static int hbtick_add_compare(unsigned long adj)
static unsigned long hbtick_get_frequency(void)
{
- struct device_node *dp = of_find_node_by_path("/");
-
- return of_getintprop_default(dp, "stick-frequency", 0);
+ return prom_getintdefault(prom_root_node, "stick-frequency", 0);
}
static struct sparc64_tick_ops hbtick_operations __read_mostly = {