diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2007-10-13 08:31:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-13 12:41:02 -0400 |
commit | 6615c5b25e0bffcb3c4463cc68e55a7f7df0b109 (patch) | |
tree | acf3d8c1807cd02cc0b8cb53413c89df799e7514 /drivers/input/mouse | |
parent | 752097cec53eea111d087c545179b421e2bde98a (diff) |
m68k: Atari input drivers cleanup
m68k: Atari input drivers cleanup:
- memleak on failed init/register of input devices fixed
- correct keycodes table (Atari keycodes are almost, but not entirely, equal
to Linux keycodes).
Signed-off-by: Michael Schmitz <schmitz@biophys.uni-duesseldorf.de>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/atarimouse.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c index 43ab6566fb65..c8c7244b48a1 100644 --- a/drivers/input/mouse/atarimouse.c +++ b/drivers/input/mouse/atarimouse.c | |||
@@ -73,14 +73,11 @@ static void atamouse_interrupt(char *buf) | |||
73 | { | 73 | { |
74 | int buttons, dx, dy; | 74 | int buttons, dx, dy; |
75 | 75 | ||
76 | /* ikbd_mouse_disable(); */ | ||
77 | |||
78 | buttons = (buf[0] & 1) | ((buf[0] & 2) << 1); | 76 | buttons = (buf[0] & 1) | ((buf[0] & 2) << 1); |
79 | #ifdef FIXED_ATARI_JOYSTICK | 77 | #ifdef FIXED_ATARI_JOYSTICK |
80 | buttons |= atari_mouse_buttons & 2; | 78 | buttons |= atari_mouse_buttons & 2; |
81 | atari_mouse_buttons = buttons; | 79 | atari_mouse_buttons = buttons; |
82 | #endif | 80 | #endif |
83 | /* ikbd_mouse_rel_pos(); */ | ||
84 | 81 | ||
85 | /* only relative events get here */ | 82 | /* only relative events get here */ |
86 | dx = buf[1]; | 83 | dx = buf[1]; |
@@ -126,15 +123,16 @@ static int __init atamouse_init(void) | |||
126 | if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ST_MFP)) | 123 | if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ST_MFP)) |
127 | return -ENODEV; | 124 | return -ENODEV; |
128 | 125 | ||
129 | if (!(atamouse_dev = input_allocate_device())) | ||
130 | return -ENOMEM; | ||
131 | |||
132 | if (!(atari_keyb_init())) | 126 | if (!(atari_keyb_init())) |
133 | return -ENODEV; | 127 | return -ENODEV; |
134 | 128 | ||
129 | atamouse_dev = input_allocate_device(); | ||
130 | if (!atamouse_dev) | ||
131 | return -ENOMEM; | ||
132 | |||
135 | atamouse_dev->name = "Atari mouse"; | 133 | atamouse_dev->name = "Atari mouse"; |
136 | atamouse_dev->phys = "atamouse/input0"; | 134 | atamouse_dev->phys = "atamouse/input0"; |
137 | atamouse_dev->id.bustype = BUS_ATARI; | 135 | atamouse_dev->id.bustype = BUS_HOST; |
138 | atamouse_dev->id.vendor = 0x0001; | 136 | atamouse_dev->id.vendor = 0x0001; |
139 | atamouse_dev->id.product = 0x0002; | 137 | atamouse_dev->id.product = 0x0002; |
140 | atamouse_dev->id.version = 0x0100; | 138 | atamouse_dev->id.version = 0x0100; |
@@ -145,9 +143,11 @@ static int __init atamouse_init(void) | |||
145 | atamouse_dev->open = atamouse_open; | 143 | atamouse_dev->open = atamouse_open; |
146 | atamouse_dev->close = atamouse_close; | 144 | atamouse_dev->close = atamouse_close; |
147 | 145 | ||
148 | input_register_device(atamouse_dev); | 146 | if (input_register_device(atamouse_dev)) { |
147 | input_free_device(atamouse_dev); | ||
148 | return -ENOMEM; | ||
149 | } | ||
149 | 150 | ||
150 | printk(KERN_INFO "input: %s at keyboard ACIA\n", atamouse_dev->name); | ||
151 | return 0; | 151 | return 0; |
152 | } | 152 | } |
153 | 153 | ||