Changeset 5a6cc679 in mainline for uspace/drv/hid/ps2mouse


Ignore:
Timestamp:
2018-01-31T02:21:24Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a0a9cc2
Parents:
132ab5d1
Message:

Merge commit '50f19b7ee8e94570b5c63896736c4eb49cfa18db' into forwardport

Not all ints are converted to errno_t in xhci tree yet, however it compiles and works :)

Location:
uspace/drv/hid/ps2mouse
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/hid/ps2mouse/main.c

    r132ab5d1 r5a6cc679  
    4545#define NAME "ps2mouse"
    4646
    47 static int mouse_add(ddf_dev_t *device);
     47static errno_t mouse_add(ddf_dev_t *device);
    4848
    4949/** DDF driver ops. */
     
    7878 * @return Error code.
    7979 */
    80 static int mouse_add(ddf_dev_t *device)
     80static errno_t mouse_add(ddf_dev_t *device)
    8181{
    82         int rc;
     82        errno_t rc;
    8383
    8484        if (!device)
  • uspace/drv/hid/ps2mouse/ps2mouse.c

    r132ab5d1 r5a6cc679  
    7777        uint8_t data = 0; \
    7878        size_t nread; \
    79         const int rc = chardev_read((mouse)->chardev, &data, 1, &nread); \
     79        const errno_t rc = chardev_read((mouse)->chardev, &data, 1, &nread); \
    8080        if (rc != EOK) { \
    8181                ddf_msg(LVL_ERROR, "Failed reading byte: %s", str_error_name(rc));\
     
    9494        uint8_t data = (value); \
    9595        size_t nwr; \
    96         const int rc = chardev_write((mouse)->chardev, &data, 1, &nwr); \
     96        const errno_t rc = chardev_write((mouse)->chardev, &data, 1, &nwr); \
    9797        if (rc != EOK) { \
    9898                ddf_msg(LVL_ERROR, "Failed writing byte: %s", str_error_name(rc)); \
     
    101101} while (0)
    102102
    103 static int polling_ps2(void *);
    104 static int polling_intellimouse(void *);
    105 static int probe_intellimouse(ps2_mouse_t *, bool);
     103static errno_t polling_ps2(void *);
     104static errno_t polling_intellimouse(void *);
     105static errno_t probe_intellimouse(ps2_mouse_t *, bool);
    106106static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
    107107
     
    120120 * @return EOK on success or non-zero error code
    121121 */
    122 int ps2_mouse_init(ps2_mouse_t *mouse, ddf_dev_t *dev)
     122errno_t ps2_mouse_init(ps2_mouse_t *mouse, ddf_dev_t *dev)
    123123{
    124124        async_sess_t *parent_sess;
    125125        bool bound = false;
    126         int rc;
     126        errno_t rc;
    127127
    128128        mouse->client_sess = NULL;
     
    165165
    166166        /* Probe IntelliMouse extensions. */
    167         int (*polling_f)(void*) = polling_ps2;
     167        errno_t (*polling_f)(void*) = polling_ps2;
    168168        if (probe_intellimouse(mouse, false) == EOK) {
    169169                ddf_msg(LVL_NOTE, "Enabled IntelliMouse extensions");
     
    223223 * @return EOK on success or non-zero error code
    224224 */
    225 static int ps2_mouse_read_packet(ps2_mouse_t *mouse, void *pbuf, size_t psize)
    226 {
    227         int rc;
     225static errno_t ps2_mouse_read_packet(ps2_mouse_t *mouse, void *pbuf, size_t psize)
     226{
     227        errno_t rc;
    228228        size_t pos;
    229229        size_t nread;
     
    248248 * @return Never.
    249249 */
    250 int polling_ps2(void *arg)
     250errno_t polling_ps2(void *arg)
    251251{
    252252        ps2_mouse_t *mouse = (ps2_mouse_t *) arg;
    253         int rc;
     253        errno_t rc;
    254254
    255255        bool buttons[PS2_BUTTON_COUNT] = {};
     
    300300 * @return Never.
    301301 */
    302 static int polling_intellimouse(void *arg)
     302static errno_t polling_intellimouse(void *arg)
    303303{
    304304        ps2_mouse_t *mouse = (ps2_mouse_t *) arg;
    305         int rc;
     305        errno_t rc;
    306306
    307307        bool buttons[INTELLIMOUSE_BUTTON_COUNT] = {};
     
    373373 * See http://www.computer-engineering.org/ps2mouse/ for details.
    374374 */
    375 static int probe_intellimouse(ps2_mouse_t *mouse, bool buttons)
     375static errno_t probe_intellimouse(ps2_mouse_t *mouse, bool buttons)
    376376{
    377377        MOUSE_WRITE_BYTE(mouse, PS2_MOUSE_SET_SAMPLE_RATE);
  • uspace/drv/hid/ps2mouse/ps2mouse.h

    r132ab5d1 r5a6cc679  
    5353} ps2_mouse_t;
    5454
    55 extern int ps2_mouse_init(ps2_mouse_t *, ddf_dev_t *);
     55extern errno_t ps2_mouse_init(ps2_mouse_t *, ddf_dev_t *);
    5656
    5757#endif
Note: See TracChangeset for help on using the changeset viewer.