aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/time.c')
-rw-r--r--arch/sparc64/kernel/time.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index d072b8632ccd..348b82035561 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -796,26 +796,26 @@ static void __init clock_assign_clk_reg(struct linux_prom_registers *clk_reg,
796 796
797static int __init clock_probe_central(void) 797static int __init clock_probe_central(void)
798{ 798{
799 struct linux_prom_registers clk_reg[2]; 799 struct linux_prom_registers clk_reg[2], *pr;
800 char model[64]; 800 struct device_node *dp;
801 int node; 801 char *model;
802 802
803 if (!central_bus) 803 if (!central_bus)
804 return 0; 804 return 0;
805 805
806 /* Get Central FHC's prom node. */ 806 /* Get Central FHC's prom node. */
807 node = central_bus->child->prom_node; 807 dp = central_bus->child->prom_node;
808 808
809 /* Then get the first child device below it. */ 809 /* Then get the first child device below it. */
810 node = prom_getchild(node); 810 dp = dp->child;
811 811
812 while (node) { 812 while (dp) {
813 prom_getstring(node, "model", model, sizeof(model)); 813 model = of_get_property(dp, "model", NULL);
814 if (!clock_model_matches(model)) 814 if (!model || !clock_model_matches(model))
815 goto next_sibling; 815 goto next_sibling;
816 816
817 prom_getproperty(node, "reg", (char *)clk_reg, 817 pr = of_get_property(dp, "reg", NULL);
818 sizeof(clk_reg)); 818 memcpy(clk_reg, pr, sizeof(clk_reg));
819 819
820 apply_fhc_ranges(central_bus->child, clk_reg, 1); 820 apply_fhc_ranges(central_bus->child, clk_reg, 1);
821 apply_central_ranges(central_bus, clk_reg, 1); 821 apply_central_ranges(central_bus, clk_reg, 1);
@@ -824,7 +824,7 @@ static int __init clock_probe_central(void)
824 return 1; 824 return 1;
825 825
826 next_sibling: 826 next_sibling:
827 node = prom_getsibling(node); 827 dp = dp->sibling;
828 } 828 }
829 829
830 return 0; 830 return 0;