[PATCH v4l-utils 4/4] keytable: a bpf protocol can have parameters and no scancodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently a protocol without scancodes does not get its parameters
parsed.

Signed-off-by: Sean Young <sean@xxxxxxxx>
---
 utils/common/keymap.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/utils/common/keymap.c b/utils/common/keymap.c
index 15c31c76..a3c1349e 100644
--- a/utils/common/keymap.c
+++ b/utils/common/keymap.c
@@ -384,13 +384,6 @@ static error_t parse_toml_protocol(const char *fname, struct toml_table_t *proot
 		return EINVAL;
 	}
 
-	scancodes = toml_table_in(proot, "scancodes");
-	if (!scancodes) {
-		if (verbose)
-			fprintf(stderr, _("%s: no [protocols.scancodes] section\n"), fname);
-		return 0;
-	}
-
 	for (i = 0; (key = toml_key_in(proot, i)) != NULL; i++) {
 		int64_t value;
 
@@ -408,6 +401,13 @@ static error_t parse_toml_protocol(const char *fname, struct toml_table_t *proot
 		}
 	}
 
+	scancodes = toml_table_in(proot, "scancodes");
+	if (!scancodes) {
+		if (verbose)
+			fprintf(stderr, _("%s: no [protocols.scancodes] section\n"), fname);
+		return 0;
+	}
+
 	struct scancode_entry **next = &map->scancode;
 	i = 0;
 
-- 
2.24.1




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux