Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/test/test3/test3.c

    rb7fd2a0 r267f235  
    4141#define NUM_FUNCS 20
    4242
    43 static errno_t test3_dev_add(ddf_dev_t *dev);
    44 static errno_t test3_dev_remove(ddf_dev_t *dev);
    45 static errno_t test3_fun_online(ddf_fun_t *fun);
    46 static errno_t test3_fun_offline(ddf_fun_t *fun);
     43static int test3_dev_add(ddf_dev_t *dev);
     44static int test3_dev_remove(ddf_dev_t *dev);
     45static int test3_fun_online(ddf_fun_t *fun);
     46static int test3_fun_offline(ddf_fun_t *fun);
    4747
    4848static driver_ops_t driver_ops = {
     
    6363} test3_t;
    6464
    65 static errno_t register_fun_and_add_to_category(ddf_dev_t *parent,
     65static int register_fun_and_add_to_category(ddf_dev_t *parent,
    6666    const char *base_name, size_t index, const char *class_name,
    6767    ddf_fun_t **pfun)
    6868{
    6969        ddf_fun_t *fun = NULL;
    70         errno_t rc;
     70        int rc;
    7171        char *fun_name = NULL;
    7272       
    73         if (asprintf(&fun_name, "%s%zu", base_name, index) < 0) {
    74                 ddf_msg(LVL_ERROR, "Failed to format string: No memory");
    75                 rc = ENOMEM;
     73        rc = asprintf(&fun_name, "%s%zu", base_name, index);
     74        if (rc < 0) {
     75                ddf_msg(LVL_ERROR, "Failed to format string: %s", str_error(rc));
    7676                goto leave;
    7777        }
     
    106106}
    107107
    108 static errno_t fun_remove(ddf_fun_t *fun, const char *name)
     108static int fun_remove(ddf_fun_t *fun, const char *name)
    109109{
    110         errno_t rc;
     110        int rc;
    111111
    112112        ddf_msg(LVL_DEBUG, "fun_remove(%p, '%s')", fun, name);
     
    127127}
    128128
    129 static errno_t test3_dev_add(ddf_dev_t *dev)
     129static int test3_dev_add(ddf_dev_t *dev)
    130130{
    131         errno_t rc = EOK;
     131        int rc = EOK;
    132132        test3_t *test3;
    133133
     
    153153}
    154154
    155 static errno_t test3_dev_remove(ddf_dev_t *dev)
     155static int test3_dev_remove(ddf_dev_t *dev)
    156156{
    157157        test3_t *test3 = (test3_t *)ddf_dev_data_get(dev);
    158158        char *fun_name;
    159         errno_t rc;
     159        int rc;
    160160        size_t i;
    161161
    162162        for (i = 0; i < NUM_FUNCS; i++) {
    163                 if (asprintf(&fun_name, "test3_%zu", i) < 0) {
    164                         ddf_msg(LVL_ERROR, "Failed to format string: No memory");
     163                rc = asprintf(&fun_name, "test3_%zu", i);
     164                if (rc < 0) {
     165                        ddf_msg(LVL_ERROR, "Failed to format string: %s", str_error(rc));
    165166                        return ENOMEM;
    166167                }
     
    176177}
    177178
    178 static errno_t test3_fun_online(ddf_fun_t *fun)
     179static int test3_fun_online(ddf_fun_t *fun)
    179180{
    180181        ddf_msg(LVL_DEBUG, "test3_fun_online()");
     
    182183}
    183184
    184 static errno_t test3_fun_offline(ddf_fun_t *fun)
     185static int test3_fun_offline(ddf_fun_t *fun)
    185186{
    186187        ddf_msg(LVL_DEBUG, "test3_fun_offline()");
Note: See TracChangeset for help on using the changeset viewer.