Index: kernel/arch/sparc64/src/drivers/kbd.c
===================================================================
--- kernel/arch/sparc64/src/drivers/kbd.c	(revision a63253421fd9024f28592eebed582cbddb29621e)
+++ kernel/arch/sparc64/src/drivers/kbd.c	(revision 8231246c805f8410b02e53e44e25bac61ac47762)
@@ -87,13 +87,13 @@
 	uint32_t interrupts;
 	prop = ofw_tree_getprop(node, "interrupts");
-	if (!prop || !prop->value)
+	if ((!prop) || (!prop->value))
 		panic("Can't find \"interrupts\" property.\n");
 	interrupts = *((uint32_t *) prop->value);
-
+	
 	/*
 	 * Read 'reg' property.
 	 */
 	prop = ofw_tree_getprop(node, "reg");
-	if (!prop || !prop->value)
+	if ((!prop) || (!prop->value))
 		panic("Can't find \"reg\" property.\n");
 	
@@ -101,5 +101,4 @@
 	size_t size;
 	inr_t inr;
-	devno_t devno = device_assign_devno();
 	
 	switch (kbd_type) {
@@ -133,7 +132,7 @@
 		};
 		break;
-
+		
 	default:
-		panic("Unexpected type.\n");
+		panic("Unexpected keyboard type.\n");
 	}
 	
@@ -146,15 +145,16 @@
 	aligned_addr = ALIGN_DOWN(pa, PAGE_SIZE);
 	offset = pa - aligned_addr;
-	uintptr_t vaddr = hw_map(aligned_addr, offset + size) + offset;
-
+	
 	switch (kbd_type) {
 #ifdef CONFIG_Z8530
 	case KBD_Z8530:
-		z8530_init(devno, vaddr, inr, cir, cir_arg);
+		z8530_init(device_assign_devno(),
+		    hw_map(aligned_addr, offset + size) + offset, inr, cir, cir_arg);
 		break;
 #endif
 #ifdef CONFIG_NS16550
 	case KBD_NS16550:
-		ns16550_init(devno, (ioport_t)vaddr, inr, cir, cir_arg);
+		ns16550_init(device_assign_devno(),
+		    (ioport_t) (hw_map(aligned_addr, offset + size) + offset), inr, cir, cir_arg);
 		break;
 #endif
Index: kernel/genarch/src/kbd/key.c
===================================================================
--- kernel/genarch/src/kbd/key.c	(revision a63253421fd9024f28592eebed582cbddb29621e)
+++ kernel/genarch/src/kbd/key.c	(revision 8231246c805f8410b02e53e44e25bac61ac47762)
@@ -42,7 +42,5 @@
 
 #if (defined(sparc64))
-#if (defined(CONFIG_Z8530) || defined(CONFIG_NS16550))
 #include <genarch/kbd/scanc_sun.h>
-#endif
 #endif
 
Index: kernel/kernel.config
===================================================================
--- kernel/kernel.config	(revision a63253421fd9024f28592eebed582cbddb29621e)
+++ kernel/kernel.config	(revision 8231246c805f8410b02e53e44e25bac61ac47762)
@@ -41,26 +41,26 @@
 ! ARCH (choice)
 
-# Compiler                                                                                                        
-@ "gcc_cross" GCC Cross-compiler                                                                                  
-@ "gcc_native" GCC Native                                                                                         
-@ "icc_native" ICC Native                                                                                         
-@ "suncc_native" Sun Studio C Compiler                                                                             
-! [ARCH=amd64|ARCH=ia32|ARCH=ia32xen] COMPILER (choice)                                               
-                                                                                                                  
-# Compiler                                                                                                        
-@ "gcc_cross" GCC Cross-compiler                                                                                  
-@ "gcc_native" GCC Native                                                                                         
-@ "icc_native" ICC Native                                                                                         
-! [ARCH=ia64] COMPILER (choice)                                                                               
-                                                                                                                  
-# Compiler                                                                                                        
-@ "gcc_cross" GCC Cross-compiler                                                                                  
-@ "gcc_native" GCC Native                                                                                         
-@ "suncc_native" Sun Studio C Compiler                                                                             
-! [ARCH=sparc64] COMPILER (choice)                                                                            
-                                                                                                                  
-# Compiler                                                                                                        
-@ "gcc_cross" GCC Cross-compiler                                                                                  
-@ "gcc_native" GCC Native                                                                                         
+# Compiler
+@ "gcc_cross" GCC Cross-compiler
+@ "gcc_native" GCC Native
+@ "icc_native" ICC Native
+@ "suncc_native" Sun Studio C Compiler
+! [ARCH=amd64|ARCH=ia32|ARCH=ia32xen] COMPILER (choice)
+
+# Compiler
+@ "gcc_cross" GCC Cross-compiler
+@ "gcc_native" GCC Native
+@ "icc_native" ICC Native
+! [ARCH=ia64] COMPILER (choice)
+
+# Compiler
+@ "gcc_cross" GCC Cross-compiler
+@ "gcc_native" GCC Native
+@ "suncc_native" Sun Studio C Compiler
+! [ARCH=sparc64] COMPILER (choice)
+
+# Compiler
+@ "gcc_cross" GCC Cross-compiler
+@ "gcc_native" GCC Native
 ! [ARCH=arm32|ARCH=mips32|ARCH=ppc32|ARCH=ppc64] COMPILER (choice)
 
@@ -144,5 +144,5 @@
 ! [ARCH=sparc64] CONFIG_Z8530 (y/n)
 
-# Support for NS16550 serial port 
+# Support for NS16550 serial port
 ! [ARCH=sparc64|(ARCH=ia64&MACHINE!=ski)] CONFIG_NS16550 (n/y)
 
