Message ID | 1324372127-8552-2-git-send-email-bill4carson@gmail.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
Hi Bill, On Tue, 20 Dec 2011 17:08:47 +0800 bill4carson@gmail.com wrote: > > From: Bill Carson <bill4carson@gmail.com> > > It make more sense to copy machine descriptor AFTER machine probe return > succeed. Some of the platform's probe routines modify the ppc_md structure and so assume that it is has been popluated before the probe routine is called.
On 2011年12月20日 18:17, Stephen Rothwell wrote: > Hi Bill, > > On Tue, 20 Dec 2011 17:08:47 +0800 bill4carson@gmail.com wrote: >> From: Bill Carson<bill4carson@gmail.com> >> >> It make more sense to copy machine descriptor AFTER machine probe return >> succeed. > Some of the platform's probe routines modify the ppc_md structure and so > assume that it is has been popluated before the probe routine is called. > I didn't see the whole picture before :( thanks for your point.
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");