[PATCH] Copy machine descriptor after probe succeed

bill4carson at gmail.com bill4carson at gmail.com
Tue Dec 20 20:08:47 EST 2011


From: Bill Carson <bill4carson at gmail.com>

It make more sense to copy machine descriptor AFTER machine probe return
succeed.

Signed-off-by: Bill Carson <bill4carson at gmail.com>
---
 arch/powerpc/kernel/setup-common.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index d426b1d..3362097 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -574,9 +574,9 @@ void probe_machine(void)
 	     machine_id < &__machine_desc_end;
 	     machine_id++) {
 		DBG("  %s ...", machine_id->name);
-		memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls));
-		if (ppc_md.probe()) {
+		if (machine_id->probe()) {
 			DBG(" match !\n");
+			memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls));
 			break;
 		}
 		DBG("\n");
-- 
1.6.3.1



More information about the Linuxppc-dev mailing list