Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/i8042/i8042.c

    rcccd60c3 r75751db6  
    269269        };
    270270       
    271         const int irq_kbd_cap = register_interrupt_handler(ddf_dev, irq_kbd,
    272             i8042_irq_handler, &irq_code);
    273         if (irq_kbd_cap < 0) {
    274                 rc = irq_kbd_cap;
     271        rc = register_interrupt_handler(ddf_dev, irq_kbd, i8042_irq_handler,
     272            &irq_code);
     273        if (rc != EOK) {
    275274                ddf_msg(LVL_ERROR, "Failed set handler for kbd: %s.",
    276275                    ddf_dev_get_name(ddf_dev));
     
    278277        }
    279278       
    280         const int irq_mouse_cap = register_interrupt_handler(ddf_dev, irq_mouse,
    281             i8042_irq_handler, &irq_code);
    282         if (irq_mouse_cap < 0) {
    283                 rc = irq_mouse_cap;
     279        rc = register_interrupt_handler(ddf_dev, irq_mouse, i8042_irq_handler,
     280            &irq_code);
     281        if (rc != EOK) {
    284282                ddf_msg(LVL_ERROR, "Failed set handler for mouse: %s.",
    285283                    ddf_dev_get_name(ddf_dev));
     
    291289        assert(parent_sess != NULL);
    292290       
    293         rc = hw_res_enable_interrupt(parent_sess, irq_kbd);
    294         if (rc != EOK) {
    295                 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to enable keyboard interrupt: %s.",
    296                     ddf_dev_get_name(ddf_dev));
    297                 rc = EIO;
    298                 goto error;
    299         }
    300 
    301         rc = hw_res_enable_interrupt(parent_sess, irq_mouse);
    302         if (rc != EOK) {
    303                 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to enable mouse interrupt: %s.",
     291        const bool enabled = hw_res_enable_interrupt(parent_sess);
     292        if (!enabled) {
     293                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to enable interrupts: %s.",
    304294                    ddf_dev_get_name(ddf_dev));
    305295                rc = EIO;
Note: See TracChangeset for help on using the changeset viewer.