From 7e844bc269b814a3b7028db9700ac51739bea6e3 Mon Sep 17 00:00:00 2001 From: Kurtis Lew Date: Tue, 5 Apr 2022 12:59:24 -0700 Subject: [PATCH] fix(behaviors): Remove `behavior_hold_tap_data` Related to discussion during development of tap-dance behavior: https://github.com/zmkfirmware/zmk/pull/1139#discussion_r810564682 This PR suggests to remove the `struct behavior_hold_tap_data` because is not used to store data for each hold tap. --- app/src/behaviors/behavior_hold_tap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/behaviors/behavior_hold_tap.c b/app/src/behaviors/behavior_hold_tap.c index 485b9dc3..030cd3dd 100644 --- a/app/src/behaviors/behavior_hold_tap.c +++ b/app/src/behaviors/behavior_hold_tap.c @@ -674,9 +674,6 @@ static int behavior_hold_tap_init(const struct device *dev) { return 0; } -struct behavior_hold_tap_data {}; -static struct behavior_hold_tap_data behavior_hold_tap_data; - #define KP_INST(n) \ static struct behavior_hold_tap_config behavior_hold_tap_config_##n = { \ .tapping_term_ms = DT_INST_PROP(n, tapping_term_ms), \ @@ -688,9 +685,9 @@ static struct behavior_hold_tap_data behavior_hold_tap_data; .hold_trigger_key_positions = DT_INST_PROP(n, hold_trigger_key_positions), \ .hold_trigger_key_positions_len = DT_INST_PROP_LEN(n, hold_trigger_key_positions), \ }; \ - DEVICE_DT_INST_DEFINE(n, behavior_hold_tap_init, NULL, &behavior_hold_tap_data, \ - &behavior_hold_tap_config_##n, APPLICATION, \ - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_hold_tap_driver_api); + DEVICE_DT_INST_DEFINE(n, behavior_hold_tap_init, NULL, NULL, &behavior_hold_tap_config_##n, \ + APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ + &behavior_hold_tap_driver_api); DT_INST_FOREACH_STATUS_OKAY(KP_INST)