Changeset 03e0beaf in mainline


Ignore:
Timestamp:
2016-12-27T12:52:04Z (8 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()

Location:
uspace/srv/hid
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/input.c

    r1a2befb r03e0beaf  
    4343#include <ipc/input.h>
    4444#include <sysinfo.h>
     45#include <config.h>
    4546#include <stdio.h>
    4647#include <unistd.h>
     
    903904        }
    904905
    905         char *boot_args;
    906         size_t size;
    907 
    908         boot_args = sysinfo_get_data("boot_args", &size);
    909         if (boot_args && size) {
    910                 char *args = boot_args;
    911                 char *arg;
    912 #define ARG_CONSOLE     "console="
    913                 while ((arg = str_tok(args, " ", &args)) != NULL) {
    914                         if (!str_lcmp(arg, ARG_CONSOLE,
    915                             str_length(ARG_CONSOLE))) {
    916                                 serial_console = arg + str_length(ARG_CONSOLE);
    917                                 break;
    918                         }
    919                 }
    920         }
     906        serial_console = config_get_value("console");
    921907       
    922908        /* Add legacy keyboard devices. */
  • 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.