* [PATCH] ppc_sys: do not BUG if system ID is unknown
@ 2005-10-26 14:57 Marcelo Tosatti
0 siblings, 0 replies; only message in thread
From: Marcelo Tosatti @ 2005-10-26 14:57 UTC (permalink / raw)
To: Vitaly Bordug, linux-ppc-embedded
Vitaly,
Subject and diff says it all: currently ppc_sys BUGs on unknown system
ID, which is quite unfriendly.
The following is applied to the 8xx-fixes tree.
diff-tree a807b39b11a2fc311d3bbeff2b6f17c31636bb58 (from 94c84a4faa99c5f1ca93f0b9c5ad3df9d57409f8)
Author: Marcelo Tosatti <marcelo@pegasos.cnet>
Date: Wed Oct 26 14:43:30 2005 -0500
ppc32: Make ppc_sys friendly to unknown system ID's
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
index 52ba0c6..26d7605 100644
--- a/arch/ppc/syslib/ppc_sys.c
+++ b/arch/ppc/syslib/ppc_sys.c
@@ -85,8 +85,11 @@ static int __init find_chip_by_name_and_
void __init identify_ppc_sys_by_name_and_id(char *name, u32 id)
{
int i = find_chip_by_name_and_id(name, id);
- BUG_ON(i < 0);
- cur_ppc_sys_spec = &ppc_sys_specs[i];
+ if (i < 0) {
+ printk(KERN_ERR "ppc_sys: Unable to identify PPC system!\n");
+ cur_ppc_sys_spec = NULL;
+ } else
+ cur_ppc_sys_spec = &ppc_sys_specs[i];
}
/* Update all memory resources by paddr, call before platform_device_register */
@@ -128,7 +131,8 @@ static int __init ppc_sys_init(void)
{
unsigned int i, dev_id, ret = 0;
- BUG_ON(cur_ppc_sys_spec == NULL);
+ if(cur_ppc_sys_spec == NULL)
+ return 1;
for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
dev_id = cur_ppc_sys_spec->device_list[i];
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2005-10-26 20:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-26 14:57 [PATCH] ppc_sys: do not BUG if system ID is unknown Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).