RISC-V: Add Sstc extension support
[sfrench/cifs-2.6.git] / drivers / clocksource / timer-riscv.c
index 05f6cf06728970f68b899dcd5423b747e03f600e..969a552da8d2971c7df54cfd6af29871a443aff7 100644 (file)
@@ -118,20 +118,21 @@ static irqreturn_t riscv_timer_interrupt(int irq, void *dev_id)
 
 static int __init riscv_timer_init_dt(struct device_node *n)
 {
-       int cpuid, hartid, error;
+       int cpuid, error;
+       unsigned long hartid;
        struct device_node *child;
        struct irq_domain *domain;
 
-       hartid = riscv_of_processor_hartid(n);
-       if (hartid < 0) {
-               pr_warn("Not valid hartid for node [%pOF] error = [%d]\n",
+       error = riscv_of_processor_hartid(n, &hartid);
+       if (error < 0) {
+               pr_warn("Not valid hartid for node [%pOF] error = [%lu]\n",
                        n, hartid);
-               return hartid;
+               return error;
        }
 
        cpuid = riscv_hartid_to_cpuid(hartid);
        if (cpuid < 0) {
-               pr_warn("Invalid cpuid for hartid [%d]\n", hartid);
+               pr_warn("Invalid cpuid for hartid [%lu]\n", hartid);
                return cpuid;
        }
 
@@ -157,7 +158,7 @@ static int __init riscv_timer_init_dt(struct device_node *n)
                return -ENODEV;
        }
 
-       pr_info("%s: Registering clocksource cpuid [%d] hartid [%d]\n",
+       pr_info("%s: Registering clocksource cpuid [%d] hartid [%lu]\n",
               __func__, cpuid, hartid);
        error = clocksource_register_hz(&riscv_clocksource, riscv_timebase);
        if (error) {