Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: make i8042_platform_init return 'real' error code

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

+26 -23
+3 -3
drivers/input/serio/i8042-io.h
··· 69 69 */ 70 70 #if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__) && !defined(CONFIG_PPC64) 71 71 if (!request_region(I8042_DATA_REG, 16, "i8042")) 72 - return -1; 72 + return -EBUSY; 73 73 #endif 74 74 75 75 i8042_reset = 1; 76 76 77 77 #if defined(CONFIG_PPC64) 78 78 if (check_legacy_ioport(I8042_DATA_REG)) 79 - return -1; 79 + return -EBUSY; 80 80 if (!request_region(I8042_DATA_REG, 16, "i8042")) 81 - return -1; 81 + return -EBUSY; 82 82 #endif 83 83 return 0; 84 84 }
+1 -1
drivers/input/serio/i8042-ip22io.h
··· 58 58 #if 0 59 59 /* XXX sgi_kh is a virtual address */ 60 60 if (!request_mem_region(sgi_kh, sizeof(struct hpc_keyb), "i8042")) 61 - return 1; 61 + return -EBUSY; 62 62 #endif 63 63 64 64 i8042_reset = 1;
+1 -1
drivers/input/serio/i8042-jazzio.h
··· 53 53 #if 0 54 54 /* XXX JAZZ_KEYBOARD_ADDRESS is a virtual address */ 55 55 if (!request_mem_region(JAZZ_KEYBOARD_ADDRESS, 2, "i8042")) 56 - return 1; 56 + return -EBUSY; 57 57 #endif 58 58 59 59 return 0;
+6 -6
drivers/input/serio/i8042-sparcio.h
··· 48 48 #define OBP_PS2MS_NAME1 "kdmouse" 49 49 #define OBP_PS2MS_NAME2 "mouse" 50 50 51 - static int i8042_platform_init(void) 51 + static int __init i8042_platform_init(void) 52 52 { 53 53 #ifndef CONFIG_PCI 54 - return -1; 54 + return -ENODEV; 55 55 #else 56 56 char prop[128]; 57 57 int len; ··· 59 59 len = prom_getproperty(prom_root_node, "name", prop, sizeof(prop)); 60 60 if (len < 0) { 61 61 printk("i8042: Cannot get name property of root OBP node.\n"); 62 - return -1; 62 + return -ENODEV; 63 63 } 64 64 if (strncmp(prop, "SUNW,JavaStation-1", len) == 0) { 65 65 /* Hardcoded values for MrCoffee. */ 66 66 i8042_kbd_irq = i8042_aux_irq = 13 | 0x20; 67 67 kbd_iobase = ioremap(0x71300060, 8); 68 68 if (!kbd_iobase) 69 - return -1; 69 + return -ENODEV; 70 70 } else { 71 71 struct linux_ebus *ebus; 72 72 struct linux_ebus_device *edev; ··· 78 78 goto edev_found; 79 79 } 80 80 } 81 - return -1; 81 + return -ENODEV; 82 82 83 83 edev_found: 84 84 for_each_edevchild(edev, child) { ··· 96 96 i8042_aux_irq == -1) { 97 97 printk("i8042: Error, 8042 device lacks both kbd and " 98 98 "mouse nodes.\n"); 99 - return -1; 99 + return -ENODEV; 100 100 } 101 101 } 102 102
+12 -10
drivers/input/serio/i8042-x86ia64io.h
··· 256 256 } 257 257 } 258 258 259 - static int i8042_pnp_init(void) 259 + static int __init i8042_pnp_init(void) 260 260 { 261 261 int result_kbd, result_aux; 262 262 ··· 322 322 return 0; 323 323 } 324 324 325 + #else 326 + static inline int i8042_pnp_init(void) { return 0; } 327 + static inline void i8042_pnp_exit(void) { } 325 328 #endif 326 329 327 - static inline int i8042_platform_init(void) 330 + static int __init i8042_platform_init(void) 328 331 { 332 + int retval; 333 + 329 334 /* 330 335 * On ix86 platforms touching the i8042 data register region can do really 331 336 * bad things. Because of this the region is always reserved on ix86 boxes. 332 337 * 333 338 * if (!request_region(I8042_DATA_REG, 16, "i8042")) 334 - * return -1; 339 + * return -EBUSY; 335 340 */ 336 341 337 342 i8042_kbd_irq = I8042_MAP_IRQ(1); 338 343 i8042_aux_irq = I8042_MAP_IRQ(12); 339 344 340 - #ifdef CONFIG_PNP 341 - if (i8042_pnp_init()) 342 - return -1; 343 - #endif 345 + retval = i8042_pnp_init(); 346 + if (retval) 347 + return retval; 344 348 345 349 #if defined(__ia64__) 346 350 i8042_reset = 1; ··· 358 354 i8042_nomux = 1; 359 355 #endif 360 356 361 - return 0; 357 + return retval; 362 358 } 363 359 364 360 static inline void i8042_platform_exit(void) 365 361 { 366 - #ifdef CONFIG_PNP 367 362 i8042_pnp_exit(); 368 - #endif 369 363 } 370 364 371 365 #endif /* _I8042_X86IA64IO_H */
+3 -2
drivers/input/serio/i8042.c
··· 1066 1066 init_timer(&i8042_timer); 1067 1067 i8042_timer.function = i8042_timer_func; 1068 1068 1069 - if (i8042_platform_init()) 1070 - return -EBUSY; 1069 + err = i8042_platform_init(); 1070 + if (err) 1071 + return err; 1071 1072 1072 1073 i8042_ports[I8042_AUX_PORT_NO].irq = I8042_AUX_IRQ; 1073 1074 i8042_ports[I8042_KBD_PORT_NO].irq = I8042_KBD_IRQ;