diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-12-07 03:49:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-07 03:49:53 -0500 |
commit | 7d3a70012005a9bcaebb5f44d5546376b9c6daa9 (patch) | |
tree | 9907702d95c46c86a42a6838a10ba49746ad1058 /arch/sparc | |
parent | bf944c370ab181ada51c0754a2d13ae8543b149a (diff) |
sparc: idprom_32.c cleanup
o Use C99 initializer for struct members
o fix code style issues
o Add KERN_WARNING to all printk
o Update prints to match sparc64
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/idprom_32.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/arch/sparc/kernel/idprom_32.c b/arch/sparc/kernel/idprom_32.c index 223a6582e1e2..3e2fe0972428 100644 --- a/arch/sparc/kernel/idprom_32.c +++ b/arch/sparc/kernel/idprom_32.c | |||
@@ -11,35 +11,36 @@ | |||
11 | 11 | ||
12 | #include <asm/oplib.h> | 12 | #include <asm/oplib.h> |
13 | #include <asm/idprom.h> | 13 | #include <asm/idprom.h> |
14 | #include <asm/machines.h> /* Fun with Sun released architectures. */ | ||
15 | 14 | ||
16 | struct idprom *idprom; | 15 | struct idprom *idprom; |
17 | static struct idprom idprom_buffer; | 16 | static struct idprom idprom_buffer; |
18 | 17 | ||
18 | #include <asm/machines.h> /* Fun with Sun released architectures. */ | ||
19 | |||
19 | /* Here is the master table of Sun machines which use some implementation | 20 | /* Here is the master table of Sun machines which use some implementation |
20 | * of the Sparc CPU and have a meaningful IDPROM machtype value that we | 21 | * of the Sparc CPU and have a meaningful IDPROM machtype value that we |
21 | * know about. See asm-sparc/machines.h for empirical constants. | 22 | * know about. See asm-sparc/machines.h for empirical constants. |
22 | */ | 23 | */ |
23 | static struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = { | 24 | static struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = { |
24 | /* First, Sun4's */ | 25 | /* First, Sun4's */ |
25 | { "Sun 4/100 Series", (SM_SUN4 | SM_4_110) }, | 26 | { .name = "Sun 4/100 Series", .id_machtype = (SM_SUN4 | SM_4_110) }, |
26 | { "Sun 4/200 Series", (SM_SUN4 | SM_4_260) }, | 27 | { .name = "Sun 4/200 Series", .id_machtype = (SM_SUN4 | SM_4_260) }, |
27 | { "Sun 4/300 Series", (SM_SUN4 | SM_4_330) }, | 28 | { .name = "Sun 4/300 Series", .id_machtype = (SM_SUN4 | SM_4_330) }, |
28 | { "Sun 4/400 Series", (SM_SUN4 | SM_4_470) }, | 29 | { .name = "Sun 4/400 Series", .id_machtype = (SM_SUN4 | SM_4_470) }, |
29 | /* Now, Sun4c's */ | 30 | /* Now, Sun4c's */ |
30 | { "Sun4c SparcStation 1", (SM_SUN4C | SM_4C_SS1) }, | 31 | { .name = "Sun4c SparcStation 1", .id_machtype = (SM_SUN4C | SM_4C_SS1) }, |
31 | { "Sun4c SparcStation IPC", (SM_SUN4C | SM_4C_IPC) }, | 32 | { .name = "Sun4c SparcStation IPC", .id_machtype = (SM_SUN4C | SM_4C_IPC) }, |
32 | { "Sun4c SparcStation 1+", (SM_SUN4C | SM_4C_SS1PLUS) }, | 33 | { .name = "Sun4c SparcStation 1+", .id_machtype = (SM_SUN4C | SM_4C_SS1PLUS) }, |
33 | { "Sun4c SparcStation SLC", (SM_SUN4C | SM_4C_SLC) }, | 34 | { .name = "Sun4c SparcStation SLC", .id_machtype = (SM_SUN4C | SM_4C_SLC) }, |
34 | { "Sun4c SparcStation 2", (SM_SUN4C | SM_4C_SS2) }, | 35 | { .name = "Sun4c SparcStation 2", .id_machtype = (SM_SUN4C | SM_4C_SS2) }, |
35 | { "Sun4c SparcStation ELC", (SM_SUN4C | SM_4C_ELC) }, | 36 | { .name = "Sun4c SparcStation ELC", .id_machtype = (SM_SUN4C | SM_4C_ELC) }, |
36 | { "Sun4c SparcStation IPX", (SM_SUN4C | SM_4C_IPX) }, | 37 | { .name = "Sun4c SparcStation IPX", .id_machtype = (SM_SUN4C | SM_4C_IPX) }, |
37 | /* Finally, early Sun4m's */ | 38 | /* Finally, early Sun4m's */ |
38 | { "Sun4m SparcSystem600", (SM_SUN4M | SM_4M_SS60) }, | 39 | { .name = "Sun4m SparcSystem600", .id_machtype = (SM_SUN4M | SM_4M_SS60) }, |
39 | { "Sun4m SparcStation10/20", (SM_SUN4M | SM_4M_SS50) }, | 40 | { .name = "Sun4m SparcStation10/20", .id_machtype = (SM_SUN4M | SM_4M_SS50) }, |
40 | { "Sun4m SparcStation5", (SM_SUN4M | SM_4M_SS40) }, | 41 | { .name = "Sun4m SparcStation5", .id_machtype = (SM_SUN4M | SM_4M_SS40) }, |
41 | /* One entry for the OBP arch's which are sun4d, sun4e, and newer sun4m's */ | 42 | /* One entry for the OBP arch's which are sun4d, sun4e, and newer sun4m's */ |
42 | { "Sun4M OBP based system", (SM_SUN4M_OBP | 0x0) } }; | 43 | { .name = "Sun4M OBP based system", .id_machtype = (SM_SUN4M_OBP | 0x0) } }; |
43 | 44 | ||
44 | static void __init display_system_type(unsigned char machtype) | 45 | static void __init display_system_type(unsigned char machtype) |
45 | { | 46 | { |
@@ -47,18 +48,19 @@ static void __init display_system_type(unsigned char machtype) | |||
47 | register int i; | 48 | register int i; |
48 | 49 | ||
49 | for (i = 0; i < NUM_SUN_MACHINES; i++) { | 50 | for (i = 0; i < NUM_SUN_MACHINES; i++) { |
50 | if(Sun_Machines[i].id_machtype == machtype) { | 51 | if (Sun_Machines[i].id_machtype == machtype) { |
51 | if (machtype != (SM_SUN4M_OBP | 0x00) || | 52 | if (machtype != (SM_SUN4M_OBP | 0x00) || |
52 | prom_getproperty(prom_root_node, "banner-name", | 53 | prom_getproperty(prom_root_node, "banner-name", |
53 | sysname, sizeof(sysname)) <= 0) | 54 | sysname, sizeof(sysname)) <= 0) |
54 | printk("TYPE: %s\n", Sun_Machines[i].name); | 55 | printk(KERN_WARNING "TYPE: %s\n", |
56 | Sun_Machines[i].name); | ||
55 | else | 57 | else |
56 | printk("TYPE: %s\n", sysname); | 58 | printk(KERN_WARNING "TYPE: %s\n", sysname); |
57 | return; | 59 | return; |
58 | } | 60 | } |
59 | } | 61 | } |
60 | 62 | ||
61 | prom_printf("IDPROM: Bogus id_machtype value, 0x%x\n", machtype); | 63 | prom_printf("IDPROM: Warning, bogus id_machtype value, 0x%x\n", machtype); |
62 | prom_halt(); | 64 | prom_halt(); |
63 | } | 65 | } |
64 | 66 | ||
@@ -80,20 +82,20 @@ void __init idprom_init(void) | |||
80 | 82 | ||
81 | idprom = &idprom_buffer; | 83 | idprom = &idprom_buffer; |
82 | 84 | ||
83 | if (idprom->id_format != 0x01) { | 85 | if (idprom->id_format != 0x01) { |
84 | prom_printf("IDPROM: Unknown format type!\n"); | 86 | prom_printf("IDPROM: Warning, unknown format type!\n"); |
85 | prom_halt(); | 87 | prom_halt(); |
86 | } | 88 | } |
87 | 89 | ||
88 | if (idprom->id_cksum != calc_idprom_cksum(idprom)) { | 90 | if (idprom->id_cksum != calc_idprom_cksum(idprom)) { |
89 | prom_printf("IDPROM: Checksum failure (nvram=%x, calc=%x)!\n", | 91 | prom_printf("IDPROM: Warning, checksum failure (nvram=%x, calc=%x)!\n", |
90 | idprom->id_cksum, calc_idprom_cksum(idprom)); | 92 | idprom->id_cksum, calc_idprom_cksum(idprom)); |
91 | prom_halt(); | 93 | prom_halt(); |
92 | } | 94 | } |
93 | 95 | ||
94 | display_system_type(idprom->id_machtype); | 96 | display_system_type(idprom->id_machtype); |
95 | 97 | ||
96 | printk("Ethernet address: %x:%x:%x:%x:%x:%x\n", | 98 | printk(KERN_WARNING "Ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n", |
97 | idprom->id_ethaddr[0], idprom->id_ethaddr[1], | 99 | idprom->id_ethaddr[0], idprom->id_ethaddr[1], |
98 | idprom->id_ethaddr[2], idprom->id_ethaddr[3], | 100 | idprom->id_ethaddr[2], idprom->id_ethaddr[3], |
99 | idprom->id_ethaddr[4], idprom->id_ethaddr[5]); | 101 | idprom->id_ethaddr[4], idprom->id_ethaddr[5]); |