Index: kernel/arch/sparc64/src/drivers/kbd.c
===================================================================
--- kernel/arch/sparc64/src/drivers/kbd.c	(revision 04de76596e4d05a3dc73b8214d009de852888337)
+++ kernel/arch/sparc64/src/drivers/kbd.c	(revision 64c7e14c83fe93421c2bc06d4ae6fdcf00e00dab)
@@ -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 04de76596e4d05a3dc73b8214d009de852888337)
+++ kernel/genarch/src/kbd/key.c	(revision 64c7e14c83fe93421c2bc06d4ae6fdcf00e00dab)
@@ -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 04de76596e4d05a3dc73b8214d009de852888337)
+++ kernel/kernel.config	(revision 64c7e14c83fe93421c2bc06d4ae6fdcf00e00dab)
@@ -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)
 
