Changeset 4f87a85a in mainline for uspace/drv/time


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/time/cmos-rtc/cmos-rtc.c

    r433d52f r4f87a85a  
    588588        errno_t rc;
    589589        bool need_cleanup = false;
     590        bool bound = false;
    590591
    591592        ddf_msg(LVL_DEBUG, "rtc_dev_add %s (handle = %d)",
     
    624625        }
    625626
     627        bound = true;
    626628        rtc->fun = fun;
    627629
    628         ddf_fun_add_to_category(fun, "clock");
     630        rc = ddf_fun_add_to_category(fun, "clock");
     631        if (rc != EOK) {
     632                ddf_msg(LVL_ERROR, "Failed adding service to clock category.");
     633                goto error;
     634        }
    629635
    630636        ddf_msg(LVL_NOTE, "Device %s successfully initialized",
     
    634640
    635641error:
     642        if (bound)
     643                ddf_fun_unbind(fun);
    636644        if (fun)
    637645                ddf_fun_destroy(fun);
     
    754762
    755763        rc = ddf_fun_online(fun);
    756         if (rc == EOK)
    757                 ddf_fun_add_to_category(fun, "clock");
     764        if (rc == EOK) {
     765                // XXX This should be probably handled by the framework
     766                rc = ddf_fun_add_to_category(fun, "clock");
     767        }
    758768
    759769        return rc;
Note: See TracChangeset for help on using the changeset viewer.