Fixed warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17991 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c6408ada23
commit
3a41b03036
@ -2,14 +2,13 @@
|
||||
* Copyright 2004-2006 Haiku, Inc.
|
||||
* Distributed under the terms of the Haiku License.
|
||||
*
|
||||
* common.c:
|
||||
* PS/2 hid device driver
|
||||
* Authors (in chronological order):
|
||||
* Stefano Ceccherini (burton666@libero.it)
|
||||
* Axel Dörfler, axeld@pinc-software.de
|
||||
* Marcus Overhagen <marcus@overhagen.de>
|
||||
*/
|
||||
|
||||
/*! PS/2 hid device driver */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@ -299,34 +298,38 @@ ps2_init(void)
|
||||
|
||||
status = get_module(B_ISA_MODULE_NAME, (module_info **)&gIsa);
|
||||
if (status < B_OK)
|
||||
goto err_1;
|
||||
return status;
|
||||
|
||||
gControllerSem = create_sem(1, "ps/2 keyb ctrl");
|
||||
|
||||
ps2_flush();
|
||||
|
||||
status = ps2_dev_init();
|
||||
if (status < B_OK)
|
||||
goto err1;
|
||||
|
||||
status = ps2_service_init();
|
||||
if (status < B_OK)
|
||||
goto err2;
|
||||
|
||||
status = install_io_interrupt_handler(INT_PS2_KEYBOARD, &ps2_interrupt, NULL, 0);
|
||||
if (status)
|
||||
goto err_3;
|
||||
goto err3;
|
||||
|
||||
status = install_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL, 0);
|
||||
if (status)
|
||||
goto err_4;
|
||||
goto err4;
|
||||
|
||||
status = ps2_setup_command_byte();
|
||||
if (status) {
|
||||
dprintf("ps2: setting up command byte failed\n");
|
||||
goto err_5;
|
||||
goto err5;
|
||||
}
|
||||
|
||||
status = ps2_setup_active_multiplexing(&gActiveMultiplexingEnabled);
|
||||
if (status) {
|
||||
dprintf("ps2: setting up active multiplexing failed\n");
|
||||
goto err_5;
|
||||
goto err5;
|
||||
}
|
||||
|
||||
ps2_service_notify_device_added(&ps2_device[PS2_DEVICE_KEYB]);
|
||||
@ -341,17 +344,17 @@ ps2_init(void)
|
||||
|
||||
return B_OK;
|
||||
|
||||
err_5:
|
||||
err5:
|
||||
remove_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL);
|
||||
err_4:
|
||||
err4:
|
||||
remove_io_interrupt_handler(INT_PS2_KEYBOARD, &ps2_interrupt, NULL);
|
||||
err_3:
|
||||
err3:
|
||||
ps2_service_exit();
|
||||
err2:
|
||||
ps2_dev_exit();
|
||||
err1:
|
||||
delete_sem(gControllerSem);
|
||||
err_2:
|
||||
put_module(B_ISA_MODULE_NAME);
|
||||
err_1:
|
||||
TRACE(("ps2_hid: init_driver failed!\n"));
|
||||
return B_ERROR;
|
||||
}
|
||||
|
@ -2,14 +2,13 @@
|
||||
* Copyright 2004-2006 Haiku, Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* PS/2 keyboard device driver
|
||||
*
|
||||
* Authors (in chronological order):
|
||||
* Stefano Ceccherini (burton666@libero.it)
|
||||
* Axel Dörfler, axeld@pinc-software.de
|
||||
* Marcus Overhagen <marcus@overhagen.de>
|
||||
*/
|
||||
|
||||
/*! PS/2 keyboard device driver */
|
||||
|
||||
#include "ps2_service.h"
|
||||
#include "kb_mouse_driver.h"
|
||||
@ -231,13 +230,13 @@ keyboard_open(const char *name, uint32 flags, void **_cookie)
|
||||
sKeyboardSem = create_sem(0, "keyboard_sem");
|
||||
if (sKeyboardSem < 0) {
|
||||
status = sKeyboardSem;
|
||||
goto err2;
|
||||
goto err1;
|
||||
}
|
||||
|
||||
sKeyBuffer = create_packet_buffer(KEY_BUFFER_SIZE * sizeof(at_kbd_io));
|
||||
if (sKeyBuffer == NULL) {
|
||||
status = B_NO_MEMORY;
|
||||
goto err3;
|
||||
goto err2;
|
||||
}
|
||||
|
||||
atomic_or(&ps2_device[PS2_DEVICE_KEYB].flags, PS2_FLAG_ENABLED);
|
||||
@ -249,14 +248,11 @@ keyboard_open(const char *name, uint32 flags, void **_cookie)
|
||||
dprintf("ps2: keyboard_open %s success\n", name);
|
||||
return B_OK;
|
||||
|
||||
err4:
|
||||
delete_packet_buffer(sKeyBuffer);
|
||||
err3:
|
||||
delete_sem(sKeyboardSem);
|
||||
err2:
|
||||
delete_sem(sKeyboardSem);
|
||||
err1:
|
||||
atomic_and(&sKeyboardOpenMask, 0);
|
||||
|
||||
|
||||
dprintf("ps2: keyboard_open %s failed\n", name);
|
||||
return status;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user