From: Huang, Tao Date: Sat, 21 Mar 2015 07:45:52 +0000 (+0800) Subject: cpufreq: rockchip_big_little: fix panic when topology_physical_package_id return... X-Git-Tag: firefly_0821_release~4158^2~323 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=39d5e26a3a712216974415637cd755d8c6969008;p=firefly-linux-kernel-4.4.55.git cpufreq: rockchip_big_little: fix panic when topology_physical_package_id return -1 if no cluster info in dts Signed-off-by: Huang, Tao --- diff --git a/drivers/cpufreq/rockchip_big_little.c b/drivers/cpufreq/rockchip_big_little.c index 9eb6b39cdbc3..c817d5b11d95 100644 --- a/drivers/cpufreq/rockchip_big_little.c +++ b/drivers/cpufreq/rockchip_big_little.c @@ -95,7 +95,10 @@ static unsigned int big_little = 1; /*******************************************************/ static inline int cpu_to_cluster(int cpu) { - return topology_physical_package_id(cpu); + int id = topology_physical_package_id(cpu); + if (id < 0) + id = 0; + return id; } static unsigned int rockchip_bl_cpufreq_get_rate(unsigned int cpu)