From: Huang, Tao Date: Mon, 4 May 2015 10:11:47 +0000 (+0800) Subject: thermal: rockchip: fix compilation warning X-Git-Tag: firefly_0821_release~4158^2~144 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=46945f71165760543f33abd3e82c011c92738899;p=firefly-linux-kernel-4.4.55.git thermal: rockchip: fix compilation warning Signed-off-by: Huang, Tao --- diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 5a435bf4f701..71c298a9c4a3 100755 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -731,6 +731,12 @@ static int rockchip_thermal_user_mode_get_temp(struct rockchip_thermal_data *the { unsigned long flags; int ret; +#ifdef TSADC_CPU_GATE + int val_cpu, temp_cpu; +#endif +#ifdef TSADC_GPU_GATE + int val_gpu, temp_gpu; +#endif local_irq_save(flags); /* GPU_GATING*/ @@ -757,13 +763,12 @@ static int rockchip_thermal_user_mode_get_temp(struct rockchip_thermal_data *the #ifdef TSADC_CPU_GATE /*channe 0*/ - u32 val_cpu_pd; - int val_cpu, temp_cpu; - /*power up, channel 0*/ writel_relaxed(0x208, thermal->regs + TSADCV2_USER_CON); while(1) { + u32 val_cpu_pd; + val_cpu_pd = readl_relaxed(thermal->regs + TSADCV2_INT_PD); udelay(TSADC_CLK_CYCLE_TIME); if ((val_cpu_pd & 0x100) == 0x100) { @@ -783,13 +788,12 @@ static int rockchip_thermal_user_mode_get_temp(struct rockchip_thermal_data *the udelay(10); /*channe 1*/ - u32 val_gpu_pd; - int val_gpu, temp_gpu; - /*power up, channel */ writel_relaxed(0x208 | 0x1, thermal->regs + TSADCV2_USER_CON); while(1) { + u32 val_gpu_pd; + val_gpu_pd = readl_relaxed(thermal->regs + TSADCV2_INT_PD); udelay(TSADC_CLK_CYCLE_TIME); if ((val_gpu_pd & 0x100) == 0x100) {