cpufreq: rockchip_big_little: fix panic when topology_physical_package_id return -1 if no cluster info in dts

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
This commit is contained in:
Huang, Tao
2015-03-21 15:45:52 +08:00
parent db2f5ed099
commit 39d5e26a3a

View File

@@ -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)