Changeset bfc5577a in mainline


Ignore:
Timestamp:
2012-04-18T20:10:55Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a44b58c
Parents:
f4ebaf3c
Message:

rtc: fix CLOCK_DEV protocol

Location:
uspace/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/device/clock_dev.c

    rf4ebaf3c rbfc5577a  
    4949clock_dev_time_get(async_sess_t *sess, struct tm *t)
    5050{
    51         ipc_call_t answer;
    5251        aid_t req;
    5352        int ret;
     
    5655
    5756        req = async_send_1(exch, DEV_IFACE_ID(CLOCK_DEV_IFACE),
    58             CLOCK_DEV_TIME_GET, &answer);
     57            CLOCK_DEV_TIME_GET, NULL);
    5958        ret = async_data_read_start(exch, t, sizeof(*t));
    6059
     
    6968
    7069        async_wait_for(req, &rc);
    71         if ((int) rc != EOK)
    72                 return ret;
    73 
    74         return (int) IPC_GET_ARG1(answer);
     70        return (int)rc;
    7571}
    7672
     
    8581clock_dev_time_set(async_sess_t *sess, struct tm *t)
    8682{
    87         ipc_call_t answer;
    8883        aid_t req;
    8984        int ret;
     
    9287
    9388        req = async_send_1(exch, DEV_IFACE_ID(CLOCK_DEV_IFACE),
    94             CLOCK_DEV_TIME_SET, &answer);
     89            CLOCK_DEV_TIME_SET, NULL);
    9590        ret = async_data_write_start(exch, t, sizeof(*t));
    9691
     
    105100
    106101        async_wait_for(req, &rc);
    107         if ((int) rc != EOK)
    108                 return ret;
    109 
    110         return (int) IPC_GET_ARG1(answer);
     102        return (int)rc;
    111103}
    112104
  • uspace/lib/drv/generic/remote_clock_dev.c

    rf4ebaf3c rbfc5577a  
    9696                async_data_read_finalize(cid, NULL, 0);
    9797                async_answer_0(callid, rc);
     98                return;
    9899        }
    99100
    100101        /* The operation was successful */
    101102        async_data_read_finalize(cid, &t, sizeof(struct tm));
    102         async_answer_1(callid, EOK, rc);
     103        async_answer_0(callid, rc);
    103104}
    104105
     
    133134
    134135        rc = (*clock_dev_ops->time_set)(fun, &t);
    135         if (rc < 0) {
    136                 /* Some error occurred */
    137                 async_answer_0(callid, rc);
    138                 return;
    139         }
    140136
    141         async_answer_1(callid, EOK, rc);
     137        async_answer_0(callid, rc);
    142138}
    143139
Note: See TracChangeset for help on using the changeset viewer.