Changes in uspace/drv/char/xtkbd/main.c [b2010e2:e882e3a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/xtkbd/main.c
rb2010e2 re882e3a 69 69 { 70 70 printf(NAME ": HelenOS XT keyboard driver.\n"); 71 ddf_log_init(NAME );71 ddf_log_init(NAME, LVL_NOTE); 72 72 return ddf_driver_main(&kbd_driver); 73 73 } … … 80 80 static int xt_kbd_add(ddf_dev_t *device) 81 81 { 82 int rc;83 84 82 if (!device) 85 83 return EINVAL; 86 84 85 #define CHECK_RET_RETURN(ret, message...) \ 86 if (ret != EOK) { \ 87 ddf_msg(LVL_ERROR, message); \ 88 return ret; \ 89 } else (void)0 90 87 91 xt_kbd_t *kbd = ddf_dev_data_alloc(device, sizeof(xt_kbd_t)); 88 if (kbd == NULL) { 89 ddf_msg(LVL_ERROR, "Failed to allocate XT/KBD driver instance."); 90 return ENOMEM; 91 } 92 int ret = (kbd == NULL) ? ENOMEM : EOK; 93 CHECK_RET_RETURN(ret, "Failed to allocate XT/KBD driver instance."); 92 94 93 rc = xt_kbd_init(kbd, device); 94 if (rc != EOK) { 95 ddf_msg(LVL_ERROR, "Failed to initialize XT_KBD driver: %s.", 96 str_error(rc)); 97 return rc; 98 } 95 ret = xt_kbd_init(kbd, device); 96 CHECK_RET_RETURN(ret, 97 "Failed to initialize XT_KBD driver: %s.", str_error(ret)); 99 98 100 99 ddf_msg(LVL_NOTE, "Controlling '%s' (%" PRIun ").", 101 d df_dev_get_name(device), ddf_dev_get_handle(device));100 device->name, device->handle); 102 101 return EOK; 103 102 }
Note:
See TracChangeset
for help on using the changeset viewer.