diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2010-05-26 17:43:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:48 -0400 |
commit | 80b5184cc537718122e036afe7e62d202b70d077 (patch) | |
tree | d4e2b400f0e951156d64d546fd563fa5a8ab02d3 /kernel/workqueue.c | |
parent | ad84bb5b98bf81deae97e3bcd814675d6b4e6f72 (diff) |
kernel/: convert cpu notifier to return encapsulate errno value
By the previous modification, the cpu notifier can return encapsulate
errno value. This converts the cpu notifiers for kernel/*.c
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 77dabbf64b8f..327d2deb4451 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -1110,7 +1110,7 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb, | |||
1110 | unsigned int cpu = (unsigned long)hcpu; | 1110 | unsigned int cpu = (unsigned long)hcpu; |
1111 | struct cpu_workqueue_struct *cwq; | 1111 | struct cpu_workqueue_struct *cwq; |
1112 | struct workqueue_struct *wq; | 1112 | struct workqueue_struct *wq; |
1113 | int ret = NOTIFY_OK; | 1113 | int err = 0; |
1114 | 1114 | ||
1115 | action &= ~CPU_TASKS_FROZEN; | 1115 | action &= ~CPU_TASKS_FROZEN; |
1116 | 1116 | ||
@@ -1124,12 +1124,13 @@ undo: | |||
1124 | 1124 | ||
1125 | switch (action) { | 1125 | switch (action) { |
1126 | case CPU_UP_PREPARE: | 1126 | case CPU_UP_PREPARE: |
1127 | if (!create_workqueue_thread(cwq, cpu)) | 1127 | err = create_workqueue_thread(cwq, cpu); |
1128 | if (!err) | ||
1128 | break; | 1129 | break; |
1129 | printk(KERN_ERR "workqueue [%s] for %i failed\n", | 1130 | printk(KERN_ERR "workqueue [%s] for %i failed\n", |
1130 | wq->name, cpu); | 1131 | wq->name, cpu); |
1131 | action = CPU_UP_CANCELED; | 1132 | action = CPU_UP_CANCELED; |
1132 | ret = NOTIFY_BAD; | 1133 | err = -ENOMEM; |
1133 | goto undo; | 1134 | goto undo; |
1134 | 1135 | ||
1135 | case CPU_ONLINE: | 1136 | case CPU_ONLINE: |
@@ -1150,7 +1151,7 @@ undo: | |||
1150 | cpumask_clear_cpu(cpu, cpu_populated_map); | 1151 | cpumask_clear_cpu(cpu, cpu_populated_map); |
1151 | } | 1152 | } |
1152 | 1153 | ||
1153 | return ret; | 1154 | return notifier_from_errno(err); |
1154 | } | 1155 | } |
1155 | 1156 | ||
1156 | #ifdef CONFIG_SMP | 1157 | #ifdef CONFIG_SMP |