]> git.itanic.dy.fi Git - log-plotter/blobdiff - main.c
Use the same config structure for command line and config file
[log-plotter] / main.c
diff --git a/main.c b/main.c
index 9356d91b2ee7d7aa8097f6747d705c0a549dbe94..a730cab1bee10559b9c63626b54ab20396ca85b8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -2,7 +2,6 @@
 #include <unistd.h>
 #include <string.h>
 
-#include "options.h"
 #include "config.h"
 #include "baud.h"
 #include "trace.h"
@@ -14,26 +13,25 @@ struct log_plotter_status plotter_state;
 
 int main(int argc, char *argv[])
 {
-       struct plotter_options options;
        struct plotter_config cfg;
        int fd, baud, ret = 0;
 
        bzero(&cfg, sizeof(cfg));
 
-       if (read_args(argc, argv, &options))
+       if (read_args(argc, argv, &cfg))
                return 1;
 
-       if (options.config_file_path)
-               populate_config_data_from_file(options.config_file_path, &cfg);
+       if (cfg.config_file_path)
+               populate_config_data_from_file(cfg.config_file_path, &cfg);
 
-       baud = options.baud_rate;
-       fd = open_at_baud(options.device_path, &baud);
+       baud = cfg.baudrate;
+       fd = open_at_baud(cfg.device_path, &baud);
        if (fd < 0)
                return 1;
 
-       if (baud != options.baud_rate) {
+       if (baud != cfg.baudrate) {
                pr_err("Failed to set baudrate to %d, only got %d\n",
-                       options.baud_rate, baud);
+                       cfg.baudrate, baud);
                ret = 1;
                goto out;
        }