aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-09-04 02:41:38 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-09-04 02:41:38 -0400
commit8d5987a6e17fa36776a0c9964db0f24c3d070862 (patch)
treefcabd9919c13d7d7eb3b77b09de852488ab7d13d /drivers/input/serio
parent0854e52d86080c1043bc8988daef2ebda4775f64 (diff)
Input: make i8042_platform_init return 'real' error code
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/i8042-io.h6
-rw-r--r--drivers/input/serio/i8042-ip22io.h2
-rw-r--r--drivers/input/serio/i8042-jazzio.h2
-rw-r--r--drivers/input/serio/i8042-sparcio.h12
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h22
-rw-r--r--drivers/input/serio/i8042.c5
6 files changed, 26 insertions, 23 deletions
diff --git a/drivers/input/serio/i8042-io.h b/drivers/input/serio/i8042-io.h
index c9e633d21d90..9a9221644250 100644
--- a/drivers/input/serio/i8042-io.h
+++ b/drivers/input/serio/i8042-io.h
@@ -69,16 +69,16 @@ static inline int i8042_platform_init(void)
69 */ 69 */
70#if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__) && !defined(CONFIG_PPC64) 70#if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__) && !defined(CONFIG_PPC64)
71 if (!request_region(I8042_DATA_REG, 16, "i8042")) 71 if (!request_region(I8042_DATA_REG, 16, "i8042"))
72 return -1; 72 return -EBUSY;
73#endif 73#endif
74 74
75 i8042_reset = 1; 75 i8042_reset = 1;
76 76
77#if defined(CONFIG_PPC64) 77#if defined(CONFIG_PPC64)
78 if (check_legacy_ioport(I8042_DATA_REG)) 78 if (check_legacy_ioport(I8042_DATA_REG))
79 return -1; 79 return -EBUSY;
80 if (!request_region(I8042_DATA_REG, 16, "i8042")) 80 if (!request_region(I8042_DATA_REG, 16, "i8042"))
81 return -1; 81 return -EBUSY;
82#endif 82#endif
83 return 0; 83 return 0;
84} 84}
diff --git a/drivers/input/serio/i8042-ip22io.h b/drivers/input/serio/i8042-ip22io.h
index 863b9c95fbb8..ee1ad27d6ed0 100644
--- a/drivers/input/serio/i8042-ip22io.h
+++ b/drivers/input/serio/i8042-ip22io.h
@@ -58,7 +58,7 @@ static inline int i8042_platform_init(void)
58#if 0 58#if 0
59 /* XXX sgi_kh is a virtual address */ 59 /* XXX sgi_kh is a virtual address */
60 if (!request_mem_region(sgi_kh, sizeof(struct hpc_keyb), "i8042")) 60 if (!request_mem_region(sgi_kh, sizeof(struct hpc_keyb), "i8042"))
61 return 1; 61 return -EBUSY;
62#endif 62#endif
63 63
64 i8042_reset = 1; 64 i8042_reset = 1;
diff --git a/drivers/input/serio/i8042-jazzio.h b/drivers/input/serio/i8042-jazzio.h
index 5c20ab131488..13fd7108eb28 100644
--- a/drivers/input/serio/i8042-jazzio.h
+++ b/drivers/input/serio/i8042-jazzio.h
@@ -53,7 +53,7 @@ static inline int i8042_platform_init(void)
53#if 0 53#if 0
54 /* XXX JAZZ_KEYBOARD_ADDRESS is a virtual address */ 54 /* XXX JAZZ_KEYBOARD_ADDRESS is a virtual address */
55 if (!request_mem_region(JAZZ_KEYBOARD_ADDRESS, 2, "i8042")) 55 if (!request_mem_region(JAZZ_KEYBOARD_ADDRESS, 2, "i8042"))
56 return 1; 56 return -EBUSY;
57#endif 57#endif
58 58
59 return 0; 59 return 0;
diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h
index da2a19812485..ed9446f6d7e3 100644
--- a/drivers/input/serio/i8042-sparcio.h
+++ b/drivers/input/serio/i8042-sparcio.h
@@ -48,10 +48,10 @@ static inline void i8042_write_command(int val)
48#define OBP_PS2MS_NAME1 "kdmouse" 48#define OBP_PS2MS_NAME1 "kdmouse"
49#define OBP_PS2MS_NAME2 "mouse" 49#define OBP_PS2MS_NAME2 "mouse"
50 50
51static int i8042_platform_init(void) 51static int __init i8042_platform_init(void)
52{ 52{
53#ifndef CONFIG_PCI 53#ifndef CONFIG_PCI
54 return -1; 54 return -ENODEV;
55#else 55#else
56 char prop[128]; 56 char prop[128];
57 int len; 57 int len;
@@ -59,14 +59,14 @@ static int i8042_platform_init(void)
59 len = prom_getproperty(prom_root_node, "name", prop, sizeof(prop)); 59 len = prom_getproperty(prom_root_node, "name", prop, sizeof(prop));
60 if (len < 0) { 60 if (len < 0) {
61 printk("i8042: Cannot get name property of root OBP node.\n"); 61 printk("i8042: Cannot get name property of root OBP node.\n");
62 return -1; 62 return -ENODEV;
63 } 63 }
64 if (strncmp(prop, "SUNW,JavaStation-1", len) == 0) { 64 if (strncmp(prop, "SUNW,JavaStation-1", len) == 0) {
65 /* Hardcoded values for MrCoffee. */ 65 /* Hardcoded values for MrCoffee. */
66 i8042_kbd_irq = i8042_aux_irq = 13 | 0x20; 66 i8042_kbd_irq = i8042_aux_irq = 13 | 0x20;
67 kbd_iobase = ioremap(0x71300060, 8); 67 kbd_iobase = ioremap(0x71300060, 8);
68 if (!kbd_iobase) 68 if (!kbd_iobase)
69 return -1; 69 return -ENODEV;
70 } else { 70 } else {
71 struct linux_ebus *ebus; 71 struct linux_ebus *ebus;
72 struct linux_ebus_device *edev; 72 struct linux_ebus_device *edev;
@@ -78,7 +78,7 @@ static int i8042_platform_init(void)
78 goto edev_found; 78 goto edev_found;
79 } 79 }
80 } 80 }
81 return -1; 81 return -ENODEV;
82 82
83 edev_found: 83 edev_found:
84 for_each_edevchild(edev, child) { 84 for_each_edevchild(edev, child) {
@@ -96,7 +96,7 @@ static int i8042_platform_init(void)
96 i8042_aux_irq == -1) { 96 i8042_aux_irq == -1) {
97 printk("i8042: Error, 8042 device lacks both kbd and " 97 printk("i8042: Error, 8042 device lacks both kbd and "
98 "mouse nodes.\n"); 98 "mouse nodes.\n");
99 return -1; 99 return -ENODEV;
100 } 100 }
101 } 101 }
102 102
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 03877c84e6ff..02bc23142ce0 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -256,7 +256,7 @@ static void i8042_pnp_exit(void)
256 } 256 }
257} 257}
258 258
259static int i8042_pnp_init(void) 259static int __init i8042_pnp_init(void)
260{ 260{
261 int result_kbd, result_aux; 261 int result_kbd, result_aux;
262 262
@@ -322,25 +322,29 @@ static int i8042_pnp_init(void)
322 return 0; 322 return 0;
323} 323}
324 324
325#else
326static inline int i8042_pnp_init(void) { return 0; }
327static inline void i8042_pnp_exit(void) { }
325#endif 328#endif
326 329
327static inline int i8042_platform_init(void) 330static int __init i8042_platform_init(void)
328{ 331{
332 int retval;
333
329/* 334/*
330 * On ix86 platforms touching the i8042 data register region can do really 335 * On ix86 platforms touching the i8042 data register region can do really
331 * bad things. Because of this the region is always reserved on ix86 boxes. 336 * bad things. Because of this the region is always reserved on ix86 boxes.
332 * 337 *
333 * if (!request_region(I8042_DATA_REG, 16, "i8042")) 338 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
334 * return -1; 339 * return -EBUSY;
335 */ 340 */
336 341
337 i8042_kbd_irq = I8042_MAP_IRQ(1); 342 i8042_kbd_irq = I8042_MAP_IRQ(1);
338 i8042_aux_irq = I8042_MAP_IRQ(12); 343 i8042_aux_irq = I8042_MAP_IRQ(12);
339 344
340#ifdef CONFIG_PNP 345 retval = i8042_pnp_init();
341 if (i8042_pnp_init()) 346 if (retval)
342 return -1; 347 return retval;
343#endif
344 348
345#if defined(__ia64__) 349#if defined(__ia64__)
346 i8042_reset = 1; 350 i8042_reset = 1;
@@ -354,14 +358,12 @@ static inline int i8042_platform_init(void)
354 i8042_nomux = 1; 358 i8042_nomux = 1;
355#endif 359#endif
356 360
357 return 0; 361 return retval;
358} 362}
359 363
360static inline void i8042_platform_exit(void) 364static inline void i8042_platform_exit(void)
361{ 365{
362#ifdef CONFIG_PNP
363 i8042_pnp_exit(); 366 i8042_pnp_exit();
364#endif
365} 367}
366 368
367#endif /* _I8042_X86IA64IO_H */ 369#endif /* _I8042_X86IA64IO_H */
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index f0d9c5f9cc36..2a76d08c4d3e 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1066,8 +1066,9 @@ static int __init i8042_init(void)
1066 init_timer(&i8042_timer); 1066 init_timer(&i8042_timer);
1067 i8042_timer.function = i8042_timer_func; 1067 i8042_timer.function = i8042_timer_func;
1068 1068
1069 if (i8042_platform_init()) 1069 err = i8042_platform_init();
1070 return -EBUSY; 1070 if (err)
1071 return err;
1071 1072
1072 i8042_ports[I8042_AUX_PORT_NO].irq = I8042_AUX_IRQ; 1073 i8042_ports[I8042_AUX_PORT_NO].irq = I8042_AUX_IRQ;
1073 i8042_ports[I8042_KBD_PORT_NO].irq = I8042_KBD_IRQ; 1074 i8042_ports[I8042_KBD_PORT_NO].irq = I8042_KBD_IRQ;