patch-2.3.6 linux/drivers/usb/keyboard.c

Next file: linux/drivers/usb/keymap-mac.c
Previous file: linux/drivers/usb/hub.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.5/linux/drivers/usb/keyboard.c linux/drivers/usb/keyboard.c
@@ -56,10 +56,12 @@
     int scancode = (int) usb_kbd_map[key];
     if(scancode)
     {
+#ifndef CONFIG_MAC_KEYBOARD
         if(scancode & PCKBD_NEEDS_E0)
         {
             handle_scancode(0xe0, 1);
         }
+#endif /* CONFIG_MAC_KEYBOARD */
         handle_scancode((scancode & ~PCKBD_NEEDS_E0), down);
     }
 }
@@ -171,7 +173,10 @@
     struct usb_endpoint_descriptor *endpoint;
     struct usb_keyboard *kbd;
 
-    interface = &dev->config[0].interface[0];
+    if (dev->descriptor.bNumConfigurations < 1)
+	return -1;
+
+    interface = &dev->config[0].altsetting[0].interface[0];
     endpoint = &interface->endpoint[0];
 
     if(interface->bInterfaceClass != 3
@@ -233,7 +238,7 @@
 	return usb_kbd_init();
 }
 
-void module_cleanup(void)
+void cleanup_module(void)
 {
 	usb_deregister(&usb_kbd_driver);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)