Changeset b7fd2a0 in mainline for uspace/drv/char


Ignore:
Timestamp:
2018-01-13T03:10:29Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

Location:
uspace/drv/char
Files:
14 edited

Legend:

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

    r36f0738 rb7fd2a0  
    6868
    6969static void i8042_char_conn(ipc_callid_t, ipc_call_t *, void *);
    70 static int i8042_read(chardev_srv_t *, void *, size_t, size_t *);
    71 static int i8042_write(chardev_srv_t *, const void *, size_t, size_t *);
     70static errno_t i8042_read(chardev_srv_t *, void *, size_t, size_t *);
     71static errno_t i8042_write(chardev_srv_t *, const void *, size_t, size_t *);
    7272
    7373static chardev_ops_t i8042_chardev_ops = {
     
    129129{
    130130        i8042_t *controller = ddf_dev_data_get(dev);
    131         int rc;
     131        errno_t rc;
    132132       
    133133        const uint8_t status = IPC_GET_ARG1(*call);
     
    158158 *
    159159 */
    160 int i8042_init(i8042_t *dev, addr_range_t *regs, int irq_kbd,
     160errno_t i8042_init(i8042_t *dev, addr_range_t *regs, int irq_kbd,
    161161    int irq_mouse, ddf_dev_t *ddf_dev)
    162162{
     
    170170        i8042_regs_t *ar;
    171171       
    172         int rc;
     172        errno_t rc;
    173173        bool kbd_bound = false;
    174174        bool aux_bound = false;
     
    350350 *
    351351 */
    352 static int i8042_write(chardev_srv_t *srv, const void *data, size_t size,
     352static errno_t i8042_write(chardev_srv_t *srv, const void *data, size_t size,
    353353    size_t *nwr)
    354354{
     
    385385 *
    386386 */
    387 static int i8042_read(chardev_srv_t *srv, void *dest, size_t size,
     387static errno_t i8042_read(chardev_srv_t *srv, void *dest, size_t size,
    388388    size_t *nread)
    389389{
     
    391391        size_t p;
    392392        uint8_t *destp = (uint8_t *)dest;
    393         int rc;
     393        errno_t rc;
    394394       
    395395        fibril_mutex_lock(&port->buf_lock);
  • uspace/drv/char/i8042/i8042.h

    r36f0738 rb7fd2a0  
    8888} i8042_t;
    8989
    90 extern int i8042_init(i8042_t *, addr_range_t *, int, int, ddf_dev_t *);
     90extern errno_t i8042_init(i8042_t *, addr_range_t *, int, int, ddf_dev_t *);
    9191
    9292#endif
  • uspace/drv/char/i8042/main.c

    r36f0738 rb7fd2a0  
    5555 *
    5656 */
    57 static int get_my_registers(ddf_dev_t *dev, addr_range_t *p_io_reg,
     57static errno_t get_my_registers(ddf_dev_t *dev, addr_range_t *p_io_reg,
    5858    int *kbd_irq, int *mouse_irq)
    5959{
     
    6666        hw_res_list_parsed_t hw_resources;
    6767        hw_res_list_parsed_init(&hw_resources);
    68         const int ret = hw_res_get_list_parsed(parent_sess, &hw_resources, 0);
     68        const errno_t ret = hw_res_get_list_parsed(parent_sess, &hw_resources, 0);
    6969        if (ret != EOK)
    7070                return ret;
     
    9696 *
    9797 */
    98 static int i8042_dev_add(ddf_dev_t *device)
     98static errno_t i8042_dev_add(ddf_dev_t *device)
    9999{
    100100        addr_range_t io_regs;
    101101        int kbd = 0;
    102102        int mouse = 0;
    103         int rc;
     103        errno_t rc;
    104104       
    105105        if (!device)
  • uspace/drv/char/msim-con/main.c

    r36f0738 rb7fd2a0  
    4343#define NAME  "msim-con"
    4444
    45 static int msim_con_dev_add(ddf_dev_t *dev);
    46 static int msim_con_dev_remove(ddf_dev_t *dev);
    47 static int msim_con_dev_gone(ddf_dev_t *dev);
    48 static int msim_con_fun_online(ddf_fun_t *fun);
    49 static int msim_con_fun_offline(ddf_fun_t *fun);
     45static errno_t msim_con_dev_add(ddf_dev_t *dev);
     46static errno_t msim_con_dev_remove(ddf_dev_t *dev);
     47static errno_t msim_con_dev_gone(ddf_dev_t *dev);
     48static errno_t msim_con_fun_online(ddf_fun_t *fun);
     49static errno_t msim_con_fun_offline(ddf_fun_t *fun);
    5050
    5151static driver_ops_t driver_ops = {
     
    6262};
    6363
    64 static int msim_con_get_res(ddf_dev_t *dev, msim_con_res_t *res)
     64static errno_t msim_con_get_res(ddf_dev_t *dev, msim_con_res_t *res)
    6565{
    6666        async_sess_t *parent_sess;
    6767        hw_res_list_parsed_t hw_res;
    68         int rc;
     68        errno_t rc;
    6969
    7070        parent_sess = ddf_dev_parent_sess_get(dev);
     
    9797}
    9898
    99 static int msim_con_dev_add(ddf_dev_t *dev)
     99static errno_t msim_con_dev_add(ddf_dev_t *dev)
    100100{
    101101        msim_con_t *msim_con;
    102102        msim_con_res_t res;
    103         int rc;
     103        errno_t rc;
    104104
    105105        ddf_msg(LVL_DEBUG, "msim_con_dev_add(%p)", dev);
     
    122122}
    123123
    124 static int msim_con_dev_remove(ddf_dev_t *dev)
     124static errno_t msim_con_dev_remove(ddf_dev_t *dev)
    125125{
    126126        msim_con_t *msim_con = (msim_con_t *)ddf_dev_data_get(dev);
     
    131131}
    132132
    133 static int msim_con_dev_gone(ddf_dev_t *dev)
     133static errno_t msim_con_dev_gone(ddf_dev_t *dev)
    134134{
    135135        msim_con_t *msim_con = (msim_con_t *)ddf_dev_data_get(dev);
     
    140140}
    141141
    142 static int msim_con_fun_online(ddf_fun_t *fun)
     142static errno_t msim_con_fun_online(ddf_fun_t *fun)
    143143{
    144144        ddf_msg(LVL_DEBUG, "msim_con_fun_online()");
     
    146146}
    147147
    148 static int msim_con_fun_offline(ddf_fun_t *fun)
     148static errno_t msim_con_fun_offline(ddf_fun_t *fun)
    149149{
    150150        ddf_msg(LVL_DEBUG, "msim_con_fun_offline()");
  • uspace/drv/char/msim-con/msim-con.c

    r36f0738 rb7fd2a0  
    4343static void msim_con_connection(ipc_callid_t, ipc_call_t *, void *);
    4444
    45 static int msim_con_read(chardev_srv_t *, void *, size_t, size_t *);
    46 static int msim_con_write(chardev_srv_t *, const void *, size_t, size_t *);
     45static errno_t msim_con_read(chardev_srv_t *, void *, size_t, size_t *);
     46static errno_t msim_con_write(chardev_srv_t *, const void *, size_t, size_t *);
    4747
    4848static chardev_ops_t msim_con_chardev_ops = {
     
    6666        msim_con_t *con = (msim_con_t *) arg;
    6767        uint8_t c;
    68         int rc;
     68        errno_t rc;
    6969
    7070        fibril_mutex_lock(&con->buf_lock);
     
    8080
    8181/** Add msim console device. */
    82 int msim_con_add(msim_con_t *con, msim_con_res_t *res)
     82errno_t msim_con_add(msim_con_t *con, msim_con_res_t *res)
    8383{
    8484        ddf_fun_t *fun = NULL;
    8585        bool subscribed = false;
    8686        irq_cmd_t *msim_cmds = NULL;
    87         int rc;
     87        errno_t rc;
    8888
    8989        circ_buf_init(&con->cbuf, con->buf, msim_con_buf_size, 1);
     
    152152
    153153/** Remove msim console device */
    154 int msim_con_remove(msim_con_t *con)
     154errno_t msim_con_remove(msim_con_t *con)
    155155{
    156156        return ENOTSUP;
     
    158158
    159159/** Msim console device gone */
    160 int msim_con_gone(msim_con_t *con)
     160errno_t msim_con_gone(msim_con_t *con)
    161161{
    162162        return ENOTSUP;
     
    169169
    170170/** Read from msim console device */
    171 static int msim_con_read(chardev_srv_t *srv, void *buf, size_t size,
     171static errno_t msim_con_read(chardev_srv_t *srv, void *buf, size_t size,
    172172    size_t *nread)
    173173{
     
    175175        size_t p;
    176176        uint8_t *bp = (uint8_t *) buf;
    177         int rc;
     177        errno_t rc;
    178178
    179179        fibril_mutex_lock(&con->buf_lock);
     
    197197
    198198/** Write to msim console device */
    199 static int msim_con_write(chardev_srv_t *srv, const void *data, size_t size,
     199static errno_t msim_con_write(chardev_srv_t *srv, const void *data, size_t size,
    200200    size_t *nwr)
    201201{
  • uspace/drv/char/msim-con/msim-con.h

    r36f0738 rb7fd2a0  
    7070} msim_con_t;
    7171
    72 extern int msim_con_add(msim_con_t *, msim_con_res_t *);
    73 extern int msim_con_remove(msim_con_t *);
    74 extern int msim_con_gone(msim_con_t *);
     72extern errno_t msim_con_add(msim_con_t *, msim_con_res_t *);
     73extern errno_t msim_con_remove(msim_con_t *);
     74extern errno_t msim_con_gone(msim_con_t *);
    7575
    7676#endif
  • uspace/drv/char/ns8250/ns8250.c

    r36f0738 rb7fd2a0  
    251251 * @return              EOK on success or non-zero error code
    252252 */
    253 static int ns8250_read(chardev_srv_t *srv, void *buf, size_t count, size_t *nread)
     253static errno_t ns8250_read(chardev_srv_t *srv, void *buf, size_t count, size_t *nread)
    254254{
    255255        ns8250_t *ns = srv_ns8250(srv);
     
    295295 * @return              EOK on success or non-zero error code
    296296 */
    297 static int ns8250_write(chardev_srv_t *srv, const void *buf, size_t count,
     297static errno_t ns8250_write(chardev_srv_t *srv, const void *buf, size_t count,
    298298    size_t *nwritten)
    299299{
     
    309309}
    310310
    311 static int ns8250_open(chardev_srvs_t *, chardev_srv_t *);
    312 static int ns8250_close(chardev_srv_t *);
     311static errno_t ns8250_open(chardev_srvs_t *, chardev_srv_t *);
     312static errno_t ns8250_close(chardev_srv_t *);
    313313static void ns8250_default_handler(chardev_srv_t *, ipc_callid_t, ipc_call_t *);
    314314
     
    324324static void ns8250_char_conn(ipc_callid_t, ipc_call_t *, void *);
    325325
    326 static int ns8250_dev_add(ddf_dev_t *dev);
    327 static int ns8250_dev_remove(ddf_dev_t *dev);
     326static errno_t ns8250_dev_add(ddf_dev_t *dev);
     327static errno_t ns8250_dev_remove(ddf_dev_t *dev);
    328328
    329329/** The serial port device driver's standard operations. */
     
    407407 * @return              Zero on success, error number otherwise
    408408 */
    409 static int ns8250_dev_initialize(ns8250_t *ns)
    410 {
    411         int ret = EOK;
     409static errno_t ns8250_dev_initialize(ns8250_t *ns)
     410{
     411        errno_t ret = EOK;
    412412       
    413413        ddf_msg(LVL_DEBUG, "ns8250_dev_initialize %s", ddf_dev_get_name(ns->dev));
     
    501501 * @return              Zero on success, error number otherwise
    502502 */
    503 static int ns8250_interrupt_enable(ns8250_t *ns)
     503static errno_t ns8250_interrupt_enable(ns8250_t *ns)
    504504{
    505505        /* Enable interrupt using IRC service. */
    506         int rc = hw_res_enable_interrupt(ns->parent_sess, ns->irq);
     506        errno_t rc = hw_res_enable_interrupt(ns->parent_sess, ns->irq);
    507507        if (rc != EOK)
    508508                return EIO;
     
    547547 *                      if the specified baud_rate is not valid).
    548548 */
    549 static int ns8250_port_set_baud_rate(ns8250_regs_t *regs, unsigned int baud_rate)
     549static errno_t ns8250_port_set_baud_rate(ns8250_regs_t *regs, unsigned int baud_rate)
    550550{
    551551        uint16_t divisor;
     
    646646 *                      is invalid.
    647647 */
    648 static int ns8250_port_set_com_props(ns8250_regs_t *regs, unsigned int parity,
     648static errno_t ns8250_port_set_com_props(ns8250_regs_t *regs, unsigned int parity,
    649649    unsigned int word_length, unsigned int stop_bits)
    650650{
     
    803803 * @param ns            Serial port device
    804804 */
    805 static inline int ns8250_register_interrupt_handler(ns8250_t *ns,
     805static inline errno_t ns8250_register_interrupt_handler(ns8250_t *ns,
    806806    cap_handle_t *handle)
    807807{
     
    814814 * @param ns            Serial port device
    815815 */
    816 static inline int ns8250_unregister_interrupt_handler(ns8250_t *ns)
     816static inline errno_t ns8250_unregister_interrupt_handler(ns8250_t *ns)
    817817{
    818818        return unregister_interrupt_handler(ns->dev, ns->irq_cap);
     
    825825 * @param dev           The serial port device.
    826826 */
    827 static int ns8250_dev_add(ddf_dev_t *dev)
     827static errno_t ns8250_dev_add(ddf_dev_t *dev)
    828828{
    829829        ns8250_t *ns = NULL;
     
    831831        bool need_cleanup = false;
    832832        bool need_unreg_intr_handler = false;
    833         int rc;
     833        errno_t rc;
    834834       
    835835        ddf_msg(LVL_DEBUG, "ns8250_dev_add %s (handle = %d)",
     
    928928}
    929929
    930 static int ns8250_dev_remove(ddf_dev_t *dev)
     930static errno_t ns8250_dev_remove(ddf_dev_t *dev)
    931931{
    932932        ns8250_t *ns = dev_ns8250(dev);
    933         int rc;
     933        errno_t rc;
    934934       
    935935        fibril_mutex_lock(&ns->mutex);
     
    963963 * @param srv           Server-side connection structure
    964964 */
    965 static int ns8250_open(chardev_srvs_t *srvs, chardev_srv_t *srv)
     965static errno_t ns8250_open(chardev_srvs_t *srvs, chardev_srv_t *srv)
    966966{
    967967        ns8250_t *ns = srv_ns8250(srv);
    968         int res;
     968        errno_t res;
    969969       
    970970        fibril_mutex_lock(&ns->mutex);
     
    987987 * @param srv           Server-side connection structure
    988988 */
    989 static int ns8250_close(chardev_srv_t *srv)
     989static errno_t ns8250_close(chardev_srv_t *srv)
    990990{
    991991        ns8250_t *data = srv_ns8250(srv);
     
    10401040 * @param stop_bits     The number of stop bits to be used.
    10411041 */
    1042 static int ns8250_set_props(ddf_dev_t *dev, unsigned int baud_rate,
     1042static errno_t ns8250_set_props(ddf_dev_t *dev, unsigned int baud_rate,
    10431043    unsigned int parity, unsigned int word_length, unsigned int stop_bits)
    10441044{
     
    10491049        ns8250_t *data = dev_ns8250(dev);
    10501050        ns8250_regs_t *regs = data->regs;
    1051         int ret;
     1051        errno_t ret;
    10521052       
    10531053        fibril_mutex_lock(&data->mutex);
     
    10721072        ns8250_t *ns8250 = srv_ns8250(srv);
    10731073        sysarg_t method = IPC_GET_IMETHOD(*call);
    1074         int ret;
     1074        errno_t ret;
    10751075        unsigned int baud_rate, parity, word_length, stop_bits;
    10761076       
  • uspace/drv/char/pl050/pl050.c

    r36f0738 rb7fd2a0  
    5151};
    5252
    53 static int pl050_dev_add(ddf_dev_t *);
    54 static int pl050_fun_online(ddf_fun_t *);
    55 static int pl050_fun_offline(ddf_fun_t *);
     53static errno_t pl050_dev_add(ddf_dev_t *);
     54static errno_t pl050_fun_online(ddf_fun_t *);
     55static errno_t pl050_fun_offline(ddf_fun_t *);
    5656static void pl050_char_conn(ipc_callid_t, ipc_call_t *, void *);
    57 static int pl050_read(chardev_srv_t *, void *, size_t, size_t *);
    58 static int pl050_write(chardev_srv_t *, const void *, size_t, size_t *);
     57static errno_t pl050_read(chardev_srv_t *, void *, size_t, size_t *);
     58static errno_t pl050_write(chardev_srv_t *, const void *, size_t, size_t *);
    5959
    6060static driver_ops_t driver_ops = {
     
    158158}
    159159
    160 static int pl050_init(pl050_t *pl050)
     160static errno_t pl050_init(pl050_t *pl050)
    161161{
    162162        hw_res_list_parsed_t res;
    163163        void *regs;
    164         int rc;
     164        errno_t rc;
    165165
    166166        fibril_mutex_initialize(&pl050->buf_lock);
     
    237237}
    238238
    239 static int pl050_read(chardev_srv_t *srv, void *buffer, size_t size,
     239static errno_t pl050_read(chardev_srv_t *srv, void *buffer, size_t size,
    240240    size_t *nread)
    241241{
     
    263263}
    264264
    265 static int pl050_write(chardev_srv_t *srv, const void *data, size_t size,
     265static errno_t pl050_write(chardev_srv_t *srv, const void *data, size_t size,
    266266    size_t *nwritten)
    267267{
     
    294294
    295295/** Add device. */
    296 static int pl050_dev_add(ddf_dev_t *dev)
     296static errno_t pl050_dev_add(ddf_dev_t *dev)
    297297{
    298298        ddf_fun_t *fun_a;
    299299        pl050_t *pl050 = NULL;
    300300        const char *mname;
    301         int rc;
     301        errno_t rc;
    302302
    303303        ddf_msg(LVL_DEBUG, "pl050_dev_add()");
     
    363363}
    364364
    365 static int pl050_fun_online(ddf_fun_t *fun)
     365static errno_t pl050_fun_online(ddf_fun_t *fun)
    366366{
    367367        ddf_msg(LVL_DEBUG, "pl050_fun_online()");
     
    369369}
    370370
    371 static int pl050_fun_offline(ddf_fun_t *fun)
     371static errno_t pl050_fun_offline(ddf_fun_t *fun)
    372372{
    373373        ddf_msg(LVL_DEBUG, "pl050_fun_offline()");
     
    377377int main(int argc, char *argv[])
    378378{
    379         int rc;
     379        errno_t rc;
    380380
    381381        printf(NAME ": HelenOS pl050 serial device driver\n");
  • uspace/drv/char/ski-con/main.c

    r36f0738 rb7fd2a0  
    4242#define NAME  "ski-con"
    4343
    44 static int ski_con_dev_add(ddf_dev_t *dev);
    45 static int ski_con_dev_remove(ddf_dev_t *dev);
    46 static int ski_con_dev_gone(ddf_dev_t *dev);
    47 static int ski_con_fun_online(ddf_fun_t *fun);
    48 static int ski_con_fun_offline(ddf_fun_t *fun);
     44static errno_t ski_con_dev_add(ddf_dev_t *dev);
     45static errno_t ski_con_dev_remove(ddf_dev_t *dev);
     46static errno_t ski_con_dev_gone(ddf_dev_t *dev);
     47static errno_t ski_con_fun_online(ddf_fun_t *fun);
     48static errno_t ski_con_fun_offline(ddf_fun_t *fun);
    4949
    5050static driver_ops_t driver_ops = {
     
    6161};
    6262
    63 static int ski_con_dev_add(ddf_dev_t *dev)
     63static errno_t ski_con_dev_add(ddf_dev_t *dev)
    6464{
    6565        ski_con_t *ski_con;
     
    7777}
    7878
    79 static int ski_con_dev_remove(ddf_dev_t *dev)
     79static errno_t ski_con_dev_remove(ddf_dev_t *dev)
    8080{
    8181        ski_con_t *ski_con = (ski_con_t *)ddf_dev_data_get(dev);
     
    8686}
    8787
    88 static int ski_con_dev_gone(ddf_dev_t *dev)
     88static errno_t ski_con_dev_gone(ddf_dev_t *dev)
    8989{
    9090        ski_con_t *ski_con = (ski_con_t *)ddf_dev_data_get(dev);
     
    9595}
    9696
    97 static int ski_con_fun_online(ddf_fun_t *fun)
     97static errno_t ski_con_fun_online(ddf_fun_t *fun)
    9898{
    9999        ddf_msg(LVL_DEBUG, "ski_con_fun_online()");
     
    101101}
    102102
    103 static int ski_con_fun_offline(ddf_fun_t *fun)
     103static errno_t ski_con_fun_offline(ddf_fun_t *fun)
    104104{
    105105        ddf_msg(LVL_DEBUG, "ski_con_fun_offline()");
  • uspace/drv/char/ski-con/ski-con.c

    r36f0738 rb7fd2a0  
    4848#define POLL_INTERVAL           10000
    4949
    50 static int ski_con_fibril(void *arg);
     50static errno_t ski_con_fibril(void *arg);
    5151static int32_t ski_con_getchar(void);
    5252static void ski_con_connection(ipc_callid_t, ipc_call_t *, void *);
    5353
    54 static int ski_con_read(chardev_srv_t *, void *, size_t, size_t *);
    55 static int ski_con_write(chardev_srv_t *, const void *, size_t, size_t *);
     54static errno_t ski_con_read(chardev_srv_t *, void *, size_t, size_t *);
     55static errno_t ski_con_write(chardev_srv_t *, const void *, size_t, size_t *);
    5656
    5757static chardev_ops_t ski_con_chardev_ops = {
     
    6363
    6464/** Add ski console device. */
    65 int ski_con_add(ski_con_t *con)
     65errno_t ski_con_add(ski_con_t *con)
    6666{
    6767        fid_t fid;
    6868        ddf_fun_t *fun = NULL;
    6969        bool bound = false;
    70         int rc;
     70        errno_t rc;
    7171
    7272        circ_buf_init(&con->cbuf, con->buf, ski_con_buf_size, 1);
     
    116116
    117117/** Remove ski console device */
    118 int ski_con_remove(ski_con_t *con)
     118errno_t ski_con_remove(ski_con_t *con)
    119119{
    120120        return ENOTSUP;
     
    122122
    123123/** Ski console device gone */
    124 int ski_con_gone(ski_con_t *con)
     124errno_t ski_con_gone(ski_con_t *con)
    125125{
    126126        return ENOTSUP;
     
    128128
    129129/** Poll Ski for keypresses. */
    130 static int ski_con_fibril(void *arg)
     130static errno_t ski_con_fibril(void *arg)
    131131{
    132132        int32_t c;
    133133        ski_con_t *con = (ski_con_t *) arg;
    134         int rc;
     134        errno_t rc;
    135135
    136136        while (1) {
     
    212212
    213213/** Read from Ski console device */
    214 static int ski_con_read(chardev_srv_t *srv, void *buf, size_t size,
     214static errno_t ski_con_read(chardev_srv_t *srv, void *buf, size_t size,
    215215    size_t *nread)
    216216{
     
    218218        size_t p;
    219219        uint8_t *bp = (uint8_t *) buf;
    220         int rc;
     220        errno_t rc;
    221221
    222222        fibril_mutex_lock(&con->buf_lock);
     
    240240
    241241/** Write to Ski console device */
    242 static int ski_con_write(chardev_srv_t *srv, const void *data, size_t size,
     242static errno_t ski_con_write(chardev_srv_t *srv, const void *data, size_t size,
    243243    size_t *nwr)
    244244{
  • uspace/drv/char/ski-con/ski-con.h

    r36f0738 rb7fd2a0  
    5858} ski_con_t;
    5959
    60 extern int ski_con_add(ski_con_t *);
    61 extern int ski_con_remove(ski_con_t *);
    62 extern int ski_con_gone(ski_con_t *);
     60extern errno_t ski_con_add(ski_con_t *);
     61extern errno_t ski_con_remove(ski_con_t *);
     62extern errno_t ski_con_gone(ski_con_t *);
    6363
    6464#endif
  • uspace/drv/char/sun4v-con/main.c

    r36f0738 rb7fd2a0  
    4040#define NAME  "sun4v-con"
    4141
    42 static int sun4v_con_dev_add(ddf_dev_t *dev);
    43 static int sun4v_con_dev_remove(ddf_dev_t *dev);
    44 static int sun4v_con_dev_gone(ddf_dev_t *dev);
    45 static int sun4v_con_fun_online(ddf_fun_t *fun);
    46 static int sun4v_con_fun_offline(ddf_fun_t *fun);
     42static errno_t sun4v_con_dev_add(ddf_dev_t *dev);
     43static errno_t sun4v_con_dev_remove(ddf_dev_t *dev);
     44static errno_t sun4v_con_dev_gone(ddf_dev_t *dev);
     45static errno_t sun4v_con_fun_online(ddf_fun_t *fun);
     46static errno_t sun4v_con_fun_offline(ddf_fun_t *fun);
    4747
    4848static driver_ops_t driver_ops = {
     
    5959};
    6060
    61 static int sun4v_con_get_res(ddf_dev_t *dev, sun4v_con_res_t *res)
     61static errno_t sun4v_con_get_res(ddf_dev_t *dev, sun4v_con_res_t *res)
    6262{
    6363        async_sess_t *parent_sess;
    6464        hw_res_list_parsed_t hw_res;
    65         int rc;
     65        errno_t rc;
    6666
    6767        parent_sess = ddf_dev_parent_sess_get(dev);
     
    8888
    8989
    90 static int sun4v_con_dev_add(ddf_dev_t *dev)
     90static errno_t sun4v_con_dev_add(ddf_dev_t *dev)
    9191{
    9292        sun4v_con_t *sun4v_con;
    9393        sun4v_con_res_t res;
    94         int rc;
     94        errno_t rc;
    9595
    9696        ddf_msg(LVL_DEBUG, "sun4v_con_dev_add(%p)", dev);
     
    112112}
    113113
    114 static int sun4v_con_dev_remove(ddf_dev_t *dev)
     114static errno_t sun4v_con_dev_remove(ddf_dev_t *dev)
    115115{
    116116        sun4v_con_t *sun4v_con = (sun4v_con_t *)ddf_dev_data_get(dev);
     
    121121}
    122122
    123 static int sun4v_con_dev_gone(ddf_dev_t *dev)
     123static errno_t sun4v_con_dev_gone(ddf_dev_t *dev)
    124124{
    125125        sun4v_con_t *sun4v_con = (sun4v_con_t *)ddf_dev_data_get(dev);
     
    130130}
    131131
    132 static int sun4v_con_fun_online(ddf_fun_t *fun)
     132static errno_t sun4v_con_fun_online(ddf_fun_t *fun)
    133133{
    134134        ddf_msg(LVL_DEBUG, "sun4v_con_fun_online()");
     
    136136}
    137137
    138 static int sun4v_con_fun_offline(ddf_fun_t *fun)
     138static errno_t sun4v_con_fun_offline(ddf_fun_t *fun)
    139139{
    140140        ddf_msg(LVL_DEBUG, "sun4v_con_fun_offline()");
  • uspace/drv/char/sun4v-con/sun4v-con.c

    r36f0738 rb7fd2a0  
    4646#define POLL_INTERVAL  10000
    4747
    48 static int sun4v_con_read(chardev_srv_t *, void *, size_t, size_t *);
    49 static int sun4v_con_write(chardev_srv_t *, const void *, size_t, size_t *);
     48static errno_t sun4v_con_read(chardev_srv_t *, void *, size_t, size_t *);
     49static errno_t sun4v_con_write(chardev_srv_t *, const void *, size_t, size_t *);
    5050
    5151static chardev_ops_t sun4v_con_chardev_ops = {
     
    6969
    7070/** Add sun4v console device. */
    71 int sun4v_con_add(sun4v_con_t *con, sun4v_con_res_t *res)
     71errno_t sun4v_con_add(sun4v_con_t *con, sun4v_con_res_t *res)
    7272{
    7373        ddf_fun_t *fun = NULL;
    74         int rc;
     74        errno_t rc;
    7575
    7676        con->res = *res;
     
    129129
    130130/** Remove sun4v console device */
    131 int sun4v_con_remove(sun4v_con_t *con)
     131errno_t sun4v_con_remove(sun4v_con_t *con)
    132132{
    133133        return ENOTSUP;
     
    135135
    136136/** Msim console device gone */
    137 int sun4v_con_gone(sun4v_con_t *con)
     137errno_t sun4v_con_gone(sun4v_con_t *con)
    138138{
    139139        return ENOTSUP;
     
    141141
    142142/** Read from Sun4v console device */
    143 static int sun4v_con_read(chardev_srv_t *srv, void *buf, size_t size,
     143static errno_t sun4v_con_read(chardev_srv_t *srv, void *buf, size_t size,
    144144    size_t *nread)
    145145{
     
    165165
    166166/** Write to Sun4v console device */
    167 static int sun4v_con_write(chardev_srv_t *srv, const void *data, size_t size,
     167static errno_t sun4v_con_write(chardev_srv_t *srv, const void *data, size_t size,
    168168    size_t *nwr)
    169169{
  • uspace/drv/char/sun4v-con/sun4v-con.h

    r36f0738 rb7fd2a0  
    6262} sun4v_con_t;
    6363
    64 extern int sun4v_con_add(sun4v_con_t *, sun4v_con_res_t *);
    65 extern int sun4v_con_remove(sun4v_con_t *);
    66 extern int sun4v_con_gone(sun4v_con_t *);
     64extern errno_t sun4v_con_add(sun4v_con_t *, sun4v_con_res_t *);
     65extern errno_t sun4v_con_remove(sun4v_con_t *);
     66extern errno_t sun4v_con_gone(sun4v_con_t *);
    6767
    6868#endif
Note: See TracChangeset for help on using the changeset viewer.