aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpufreq/cpufreq.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 35a26a3e5f68..0d054873da75 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1221,22 +1221,18 @@ static int cpufreq_suspend(struct sys_device * sysdev, pm_message_t pmsg)
1221 return -EINVAL; 1221 return -EINVAL;
1222 1222
1223 /* only handle each CPU group once */ 1223 /* only handle each CPU group once */
1224 if (unlikely(cpu_policy->cpu != cpu)) { 1224 if (unlikely(cpu_policy->cpu != cpu))
1225 cpufreq_cpu_put(cpu_policy); 1225 goto out;
1226 return 0;
1227 }
1228 1226
1229 if (cpufreq_driver->suspend) { 1227 if (cpufreq_driver->suspend) {
1230 ret = cpufreq_driver->suspend(cpu_policy, pmsg); 1228 ret = cpufreq_driver->suspend(cpu_policy, pmsg);
1231 if (ret) { 1229 if (ret) {
1232 printk(KERN_ERR "cpufreq: suspend failed in ->suspend " 1230 printk(KERN_ERR "cpufreq: suspend failed in ->suspend "
1233 "step on CPU %u\n", cpu_policy->cpu); 1231 "step on CPU %u\n", cpu_policy->cpu);
1234 cpufreq_cpu_put(cpu_policy); 1232 goto out;
1235 return ret;
1236 } 1233 }
1237 } 1234 }
1238 1235
1239
1240 if (cpufreq_driver->flags & CPUFREQ_CONST_LOOPS) 1236 if (cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)
1241 goto out; 1237 goto out;
1242 1238
@@ -1270,7 +1266,7 @@ static int cpufreq_suspend(struct sys_device * sysdev, pm_message_t pmsg)
1270 1266
1271out: 1267out:
1272 cpufreq_cpu_put(cpu_policy); 1268 cpufreq_cpu_put(cpu_policy);
1273 return 0; 1269 return ret;
1274} 1270}
1275 1271
1276/** 1272/**
@@ -1302,18 +1298,15 @@ static int cpufreq_resume(struct sys_device * sysdev)
1302 return -EINVAL; 1298 return -EINVAL;
1303 1299
1304 /* only handle each CPU group once */ 1300 /* only handle each CPU group once */
1305 if (unlikely(cpu_policy->cpu != cpu)) { 1301 if (unlikely(cpu_policy->cpu != cpu))
1306 cpufreq_cpu_put(cpu_policy); 1302 goto fail;
1307 return 0;
1308 }
1309 1303
1310 if (cpufreq_driver->resume) { 1304 if (cpufreq_driver->resume) {
1311 ret = cpufreq_driver->resume(cpu_policy); 1305 ret = cpufreq_driver->resume(cpu_policy);
1312 if (ret) { 1306 if (ret) {
1313 printk(KERN_ERR "cpufreq: resume failed in ->resume " 1307 printk(KERN_ERR "cpufreq: resume failed in ->resume "
1314 "step on CPU %u\n", cpu_policy->cpu); 1308 "step on CPU %u\n", cpu_policy->cpu);
1315 cpufreq_cpu_put(cpu_policy); 1309 goto fail;
1316 return ret;
1317 } 1310 }
1318 } 1311 }
1319 1312
@@ -1353,6 +1346,7 @@ static int cpufreq_resume(struct sys_device * sysdev)
1353 1346
1354out: 1347out:
1355 schedule_work(&cpu_policy->update); 1348 schedule_work(&cpu_policy->update);
1349fail:
1356 cpufreq_cpu_put(cpu_policy); 1350 cpufreq_cpu_put(cpu_policy);
1357 return ret; 1351 return ret;
1358} 1352}