Ignore:
Timestamp:
2016-12-27T12:52:04Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ce5a0f1
Parents:
1a2befb
Message:

Switch to using config_get_value()

File:
1 edited

Legend:

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

    r1a2befb r03e0beaf  
    3939#include <errno.h>
    4040#include <str.h>
    41 #include <sysinfo.h>
     41#include <config.h>
    4242#include "../ctl/serial.h"
    4343#include "../output.h"
     
    134134int chardev_init(void)
    135135{
    136         char *boot_args;
    137         size_t size;
    138         int rc;
    139 
    140         boot_args = sysinfo_get_data("boot_args", &size);
    141         if (!boot_args || !size) {
     136        console = config_get_value("console");
     137        if (!console) {
    142138                /*
    143                  * Ok, there is nothing in the boot arguments. That means that
    144                  * the user did not specify a serial console device.
     139                 * The system is not configured to use serial console.
    145140                 */
    146141                return EOK;
    147142        }
    148143
    149         char *args = boot_args;
    150         char *arg;
    151 #define ARG_CONSOLE     "console="
    152         while ((arg = str_tok(args, " ", &args)) != NULL) {
    153                 if (!str_lcmp(arg, ARG_CONSOLE, str_length(ARG_CONSOLE))) {
    154                         console = arg + str_length(ARG_CONSOLE);
    155                         break;
    156                 }
    157         }
    158 
    159         if (!console) {
    160                 /*
    161                  * The user specified some boot arguments, but the serial
    162                  * console service was not among them.
    163                  */
    164                 return EOK;
    165         }
    166 
    167         rc = loc_category_get_id("serial", &serial_cat_id, IPC_FLAG_BLOCKING);
     144        int rc = loc_category_get_id("serial", &serial_cat_id, IPC_FLAG_BLOCKING);
    168145        if (rc != EOK) {
    169146                printf("%s: Failed to get \"serial\" category ID.\n", NAME);
Note: See TracChangeset for help on using the changeset viewer.