kernel/: convert cpu notifier to return encapsulate errno value
[pandora-kernel.git] / kernel / workqueue.c
index 77dabbf..327d2de 100644 (file)
@@ -1110,7 +1110,7 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
        unsigned int cpu = (unsigned long)hcpu;
        struct cpu_workqueue_struct *cwq;
        struct workqueue_struct *wq;
-       int ret = NOTIFY_OK;
+       int err = 0;
 
        action &= ~CPU_TASKS_FROZEN;
 
@@ -1124,12 +1124,13 @@ undo:
 
                switch (action) {
                case CPU_UP_PREPARE:
-                       if (!create_workqueue_thread(cwq, cpu))
+                       err = create_workqueue_thread(cwq, cpu);
+                       if (!err)
                                break;
                        printk(KERN_ERR "workqueue [%s] for %i failed\n",
                                wq->name, cpu);
                        action = CPU_UP_CANCELED;
-                       ret = NOTIFY_BAD;
+                       err = -ENOMEM;
                        goto undo;
 
                case CPU_ONLINE:
@@ -1150,7 +1151,7 @@ undo:
                cpumask_clear_cpu(cpu, cpu_populated_map);
        }
 
-       return ret;
+       return notifier_from_errno(err);
 }
 
 #ifdef CONFIG_SMP