Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: ppc-corenet-cpufreq: Fix __udivdi3 modpost error

bfa709bc823fc32ee8dd5220d1711b46078235d8 (cpufreq: powerpc: add cpufreq
transition latency for FSL e500mc SoCs) introduced a modpost error:

ERROR: "__udivdi3" [drivers/cpufreq/ppc-corenet-cpufreq.ko] undefined!
make[1]: *** [__modpost] Error 1

Fix this by avoiding 64 bit integer division.

gcc version 4.8.2

Fixes: bfa709bc823f (cpufreq: powerpc: add cpufreq transition latency for FSL e500mc SoCs)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Tim Gardner and committed by
Rafael J. Wysocki
6712d293 8997b185

+4 -1
+4 -1
drivers/cpufreq/ppc-corenet-cpufreq.c
··· 138 138 struct cpufreq_frequency_table *table; 139 139 struct cpu_data *data; 140 140 unsigned int cpu = policy->cpu; 141 + u64 transition_latency_hz; 141 142 142 143 np = of_get_cpu_node(cpu, NULL); 143 144 if (!np) ··· 206 205 for_each_cpu(i, per_cpu(cpu_mask, cpu)) 207 206 per_cpu(cpu_data, i) = data; 208 207 208 + transition_latency_hz = 12ULL * NSEC_PER_SEC; 209 209 policy->cpuinfo.transition_latency = 210 - (12ULL * NSEC_PER_SEC) / fsl_get_sys_freq(); 210 + do_div(transition_latency_hz, fsl_get_sys_freq()); 211 + 211 212 of_node_put(np); 212 213 213 214 return 0;