diff options
author | Dave Jones <davej@redhat.com> | 2008-02-07 16:32:18 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2008-04-28 15:05:41 -0400 |
commit | c906049447019d69b9cc2d591a142af561afa7f9 (patch) | |
tree | 8ee10b19baf32b1396f0cf85ec6707a6f42e45a8 /drivers/cpufreq/cpufreq.c | |
parent | e31a94ed371c70855eb30b77c490d6d85dd4da26 (diff) |
[CPUFREQ] Slightly shorten the error paths of cpufreq_suspend/cpufreq_resume
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 22 |
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 | ||
1271 | out: | 1267 | out: |
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 | ||
1354 | out: | 1347 | out: |
1355 | schedule_work(&cpu_policy->update); | 1348 | schedule_work(&cpu_policy->update); |
1349 | fail: | ||
1356 | cpufreq_cpu_put(cpu_policy); | 1350 | cpufreq_cpu_put(cpu_policy); |
1357 | return ret; | 1351 | return ret; |
1358 | } | 1352 | } |