Changeset e6edc8d1 in mainline for uspace/drv/char/xtkbd/main.c


Ignore:
Timestamp:
2013-07-11T19:13:37Z (11 years ago)
Author:
Manuele Conti <conti.ma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
67632f7
Parents:
52ff62d3 (diff), 2b3e8840 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/xtkbd/main.c

    r52ff62d3 re6edc8d1  
    8080static int xt_kbd_add(ddf_dev_t *device)
    8181{
     82        int rc;
     83
    8284        if (!device)
    8385                return EINVAL;
    8486
    85 #define CHECK_RET_RETURN(ret, message...) \
    86 if (ret != EOK) { \
    87         ddf_msg(LVL_ERROR, message); \
    88         return ret; \
    89 } else (void)0
     87        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        }
    9092
    91         xt_kbd_t *kbd = ddf_dev_data_alloc(device, sizeof(xt_kbd_t));
    92         int ret = (kbd == NULL) ? ENOMEM : EOK;
    93         CHECK_RET_RETURN(ret, "Failed to allocate XT/KBD driver instance.");
    94 
    95         ret = xt_kbd_init(kbd, device);
    96         CHECK_RET_RETURN(ret,
    97             "Failed to initialize XT_KBD driver: %s.", str_error(ret));
     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        }
    9899
    99100        ddf_msg(LVL_NOTE, "Controlling '%s' (%" PRIun ").",
Note: See TracChangeset for help on using the changeset viewer.