]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/stop_machine.c
Merge git://git.infradead.org/mtd-2.6
[linux-2.6-omap-h63xx.git] / kernel / stop_machine.c
index 0e688c6a1a63d22d6b034de5af7b2891c1df2aad..9bc4c00872c927a1033013a31ab19630ba9dc170 100644 (file)
@@ -66,6 +66,7 @@ static void stop_cpu(struct work_struct *unused)
        enum stopmachine_state curstate = STOPMACHINE_NONE;
        struct stop_machine_data *smdata = &idle;
        int cpu = smp_processor_id();
+       int err;
 
        if (!active_cpus) {
                if (cpu == first_cpu(cpu_online_map))
@@ -86,9 +87,11 @@ static void stop_cpu(struct work_struct *unused)
                                hard_irq_disable();
                                break;
                        case STOPMACHINE_RUN:
-                               /* |= allows error detection if functions on
-                                * multiple CPUs. */
-                               smdata->fnret |= smdata->fn(smdata->data);
+                               /* On multiple CPUs only a single error code
+                                * is needed to tell that something failed. */
+                               err = smdata->fn(smdata->data);
+                               if (err)
+                                       smdata->fnret = err;
                                break;
                        default:
                                break;
@@ -157,4 +160,4 @@ static int __init stop_machine_init(void)
        stop_machine_work = alloc_percpu(struct work_struct);
        return 0;
 }
-early_initcall(stop_machine_init);
+core_initcall(stop_machine_init);