Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 74017ce in mainline for uspace/srv/hid/output/port/chardev.c


Ignore:
Timestamp:
2017-11-22T17:36:54Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
7a6065c
Parents:
c4c6025
git-author:
Jiri Svoboda <jiri@…> (2017-11-22 15:53:34)
git-committer:
Jiri Svoboda <jiri@…> (2017-11-22 17:36:54)
Message:

Convert char_dev_iface users to chardev.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/output/port/chardev.c

    rc4c6025 r74017ce  
    3030 */
    3131
     32#include <async.h>
     33#include <config.h>
     34#include <errno.h>
     35#include <fibril_synch.h>
     36#include <io/chardev.h>
     37#include <loc.h>
    3238#include <stddef.h>
    3339#include <stdint.h>
    34 #include <char_dev_iface.h>
    3540#include <stdio.h>
    3641#include <stdlib.h>
    37 #include <async.h>
    38 #include <fibril_synch.h>
    39 #include <loc.h>
    40 #include <errno.h>
    4142#include <str.h>
    42 #include <config.h>
    4343#include "../ctl/serial.h"
    4444#include "../output.h"
     
    4848
    4949static async_sess_t *sess;
     50static chardev_t *chardev;
    5051static service_id_t serial_cat_id;
    5152
     
    5758{
    5859        uint8_t byte = (uint8_t) ch;
    59         char_dev_write(sess, &byte, 1);
     60        size_t nwr;
     61        chardev_write(chardev, &byte, 1, &nwr);
     62        /* XXX Handle error */
    6063}
    6164
    6265static void chardev_control_puts(const char *str)
    6366{
    64         char_dev_write(sess, (void *) str, str_size(str));
     67        size_t nwr;
     68        chardev_write(chardev, (void *) str, str_size(str), &nwr);
     69        /* XXX Handle error */
    6570}
    6671
     
    126131                return;
    127132        }
     133
     134        rc = chardev_open(sess, &chardev);
     135        if (rc != EOK) {
     136                fibril_mutex_unlock(&discovery_lock);
     137                printf("%s: Failed opening character device\n", NAME);
     138                return;
     139        }
     140
    128141        serial_init(chardev_putchar, chardev_control_puts);
    129142
Note: See TracChangeset for help on using the changeset viewer.