Changeset 4f87a85a in mainline for uspace/drv/char


Ignore:
Timestamp:
2018-12-10T14:29:35Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ca4c5596
Parents:
433d52f
git-author:
Jiri Svoboda <jiri@…> (2018-12-10 07:39:07)
git-committer:
Jiri Svoboda <jiri@…> (2018-12-10 14:29:35)
Message:

Check return code from ddf_add_fun_to_category

Location:
uspace/drv/char
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/msim-con/msim-con.c

    r433d52f r4f87a85a  
    8585        irq_cmd_t *msim_cmds = NULL;
    8686        errno_t rc;
     87        bool bound = false;
    8788
    8889        circ_buf_init(&con->cbuf, con->buf, msim_con_buf_size, 1);
     
    143144        }
    144145
    145         ddf_fun_add_to_category(fun, "console");
     146        bound = true;
     147
     148        rc = ddf_fun_add_to_category(fun, "console");
     149        if (rc != EOK) {
     150                ddf_msg(LVL_ERROR, "Error adding function 'a' to category "
     151                    "'console'.");
     152                goto error;
     153        }
    146154
    147155        return EOK;
     
    149157        if (CAP_HANDLE_VALID(con->irq_handle))
    150158                async_irq_unsubscribe(con->irq_handle);
     159        if (bound)
     160                ddf_fun_unbind(fun);
    151161        if (fun != NULL)
    152162                ddf_fun_destroy(fun);
  • uspace/drv/char/ns8250/ns8250.c

    r433d52f r4f87a85a  
    829829        bool need_cleanup = false;
    830830        bool need_unreg_intr_handler = false;
     831        bool bound = false;
    831832        errno_t rc;
    832833
     
    909910        }
    910911
     912        bound = true;
    911913        ns->fun = fun;
    912914
    913         ddf_fun_add_to_category(fun, "serial");
     915        rc = ddf_fun_add_to_category(fun, "serial");
     916        if (rc != EOK) {
     917                ddf_msg(LVL_ERROR, "Error adding function to category 'serial'.");
     918                goto fail;
     919        }
    914920
    915921        ddf_msg(LVL_NOTE, "Device %s successfully initialized.",
     
    918924        return EOK;
    919925fail:
     926        if (bound)
     927                ddf_fun_unbind(fun);
    920928        if (fun != NULL)
    921929                ddf_fun_destroy(fun);
  • uspace/drv/char/ski-con/ski-con.c

    r433d52f r4f87a85a  
    112112        }
    113113
    114         ddf_fun_add_to_category(fun, "console");
    115 
    116114        bound = true;
     115
     116        rc = ddf_fun_add_to_category(fun, "console");
     117        if (rc != EOK) {
     118                ddf_msg(LVL_ERROR, "Error adding function 'a' to category "
     119                    "'console'.");
     120                goto error;
     121        }
    117122
    118123        fid = fibril_create(ski_con_fibril, con);
  • uspace/drv/char/sun4v-con/sun4v-con.c

    r433d52f r4f87a85a  
    7474        ddf_fun_t *fun = NULL;
    7575        errno_t rc;
     76        bool bound = false;
    7677
    7778        con->res = *res;
     
    113114        }
    114115
    115         ddf_fun_add_to_category(fun, "console");
     116        bound = true;
     117
     118        rc = ddf_fun_add_to_category(fun, "console");
     119        if (rc != EOK) {
     120                ddf_msg(LVL_ERROR, "Error adding function 'a' to category "
     121                    "'console'.");
     122                goto error;
     123        }
    116124
    117125        return EOK;
     
    122130        if (con->output_buffer != (niagara_output_buffer_t *) AS_AREA_ANY)
    123131                physmem_unmap((void *) con->output_buffer);
     132
     133        if (bound)
     134                ddf_fun_unbind(fun);
    124135
    125136        if (fun != NULL)
Note: See TracChangeset for help on using the changeset viewer.