diff options
author | Peter Johanson <[email protected]> | 2023-06-23 07:19:57 +0000 |
---|---|---|
committer | Pete Johanson <[email protected]> | 2024-02-09 14:32:46 -0800 |
commit | bf4008da023189b885ebcf1c0ccdb729663312e8 (patch) | |
tree | 7cf6fb7c7218b562b987f230094ecefe8c559cee | |
parent | f4fce9e15832fd8daee9091d7d77a272aecb8f3e (diff) | |
download | zmk-bf4008da023189b885ebcf1c0ccdb729663312e8.tar.gz zmk-bf4008da023189b885ebcf1c0ccdb729663312e8.zip |
refactor: All SYS_INIT functions are void args.
-rw-r--r-- | app/boards/arm/mikoto/pinmux.c | 3 | ||||
-rw-r--r-- | app/boards/arm/nrfmicro/pinmux.c | 4 | ||||
-rw-r--r-- | app/boards/arm/puchi_ble/pinmux.c | 4 | ||||
-rw-r--r-- | app/include/zmk/hog.h | 2 | ||||
-rw-r--r-- | app/src/activity.c | 2 | ||||
-rw-r--r-- | app/src/backlight.c | 2 | ||||
-rw-r--r-- | app/src/battery.c | 2 | ||||
-rw-r--r-- | app/src/behavior.c | 4 | ||||
-rw-r--r-- | app/src/ble.c | 2 | ||||
-rw-r--r-- | app/src/combo.c | 2 | ||||
-rw-r--r-- | app/src/endpoints.c | 2 | ||||
-rw-r--r-- | app/src/hog.c | 2 | ||||
-rw-r--r-- | app/src/rgb_underglow.c | 2 | ||||
-rw-r--r-- | app/src/sensors.c | 2 | ||||
-rw-r--r-- | app/src/split/bluetooth/central.c | 2 | ||||
-rw-r--r-- | app/src/split/bluetooth/peripheral.c | 2 | ||||
-rw-r--r-- | app/src/split/bluetooth/service.c | 2 | ||||
-rw-r--r-- | app/src/usb.c | 2 | ||||
-rw-r--r-- | app/src/usb_hid.c | 2 | ||||
-rw-r--r-- | app/src/workqueue.c | 2 | ||||
-rw-r--r-- | app/src/wpm.c | 2 |
21 files changed, 20 insertions, 29 deletions
diff --git a/app/boards/arm/mikoto/pinmux.c b/app/boards/arm/mikoto/pinmux.c index 524aa17e5b..c34c2dc85b 100644 --- a/app/boards/arm/mikoto/pinmux.c +++ b/app/boards/arm/mikoto/pinmux.c @@ -11,8 +11,7 @@ #include <zephyr/sys/sys_io.h> #include <zephyr/devicetree.h> -static int pinmux_mikoto_init(const struct device *port) { - ARG_UNUSED(port); +static int pinmux_mikoto_init(void) { #if CONFIG_BOARD_MIKOTO_520 const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0)); diff --git a/app/boards/arm/nrfmicro/pinmux.c b/app/boards/arm/nrfmicro/pinmux.c index 6362b39250..2e6674ada4 100644 --- a/app/boards/arm/nrfmicro/pinmux.c +++ b/app/boards/arm/nrfmicro/pinmux.c @@ -11,9 +11,7 @@ #include <zephyr/sys/sys_io.h> #include <zephyr/devicetree.h> -static int pinmux_nrfmicro_init(const struct device *port) { - ARG_UNUSED(port); - +static int pinmux_nrfmicro_init(void) { #if (CONFIG_BOARD_NRFMICRO_13 || CONFIG_BOARD_NRFMICRO_13_52833) const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0)); #if CONFIG_BOARD_NRFMICRO_CHARGER diff --git a/app/boards/arm/puchi_ble/pinmux.c b/app/boards/arm/puchi_ble/pinmux.c index 2817827493..8475cfb1bd 100644 --- a/app/boards/arm/puchi_ble/pinmux.c +++ b/app/boards/arm/puchi_ble/pinmux.c @@ -11,9 +11,7 @@ #include <zephyr/sys/sys_io.h> #include <zephyr/devicetree.h> -static int pinmux_puchi_ble_init(const struct device *port) { - ARG_UNUSED(port); - +static int pinmux_puchi_ble_init(void) { #if CONFIG_BOARD_PUCHI_BLE_v1 const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0)); #if CONFIG_BOARD_PUCHI_BLE_CHARGER diff --git a/app/include/zmk/hog.h b/app/include/zmk/hog.h index 5ea9912664..eb6e653f77 100644 --- a/app/include/zmk/hog.h +++ b/app/include/zmk/hog.h @@ -9,8 +9,6 @@ #include <zmk/keys.h> #include <zmk/hid.h> -int zmk_hog_init(const struct device *_arg); - int zmk_hog_send_keyboard_report(struct zmk_hid_keyboard_report_body *body); int zmk_hog_send_consumer_report(struct zmk_hid_consumer_report_body *body); diff --git a/app/src/activity.c b/app/src/activity.c index 58b11b2112..330008b3e4 100644 --- a/app/src/activity.c +++ b/app/src/activity.c @@ -84,7 +84,7 @@ void activity_expiry_function(struct k_timer *_timer) { k_work_submit(&activity_ K_TIMER_DEFINE(activity_timer, activity_expiry_function, NULL); -int activity_init(const struct device *_device) { +static int activity_init(void) { activity_last_uptime = k_uptime_get(); k_timer_start(&activity_timer, K_SECONDS(1), K_SECONDS(1)); diff --git a/app/src/backlight.c b/app/src/backlight.c index 9497f313af..f050978ff9 100644 --- a/app/src/backlight.c +++ b/app/src/backlight.c @@ -78,7 +78,7 @@ static void backlight_save_work_handler(struct k_work *work) { static struct k_work_delayable backlight_save_work; #endif -static int zmk_backlight_init(const struct device *_arg) { +static int zmk_backlight_init(void) { if (!device_is_ready(backlight_dev)) { LOG_ERR("Backlight device \"%s\" is not ready", backlight_dev->name); return -ENODEV; diff --git a/app/src/battery.c b/app/src/battery.c index 69eee2f446..1295f82248 100644 --- a/app/src/battery.c +++ b/app/src/battery.c @@ -92,7 +92,7 @@ static void zmk_battery_start_reporting() { } } -static int zmk_battery_init(const struct device *_arg) { +static int zmk_battery_init(void) { #if !DT_HAS_CHOSEN(zmk_battery) battery = device_get_binding("BATTERY"); diff --git a/app/src/behavior.c b/app/src/behavior.c index fd2b0ec175..fa2005ff1a 100644 --- a/app/src/behavior.c +++ b/app/src/behavior.c @@ -40,9 +40,7 @@ const struct device *z_impl_behavior_get_binding(const char *name) { } #if IS_ENABLED(CONFIG_LOG) -static int check_behavior_names(const struct device *dev) { - ARG_UNUSED(dev); - +static int check_behavior_names(void) { // Behavior names must be unique, but we don't have a good way to enforce this // at compile time, so log an error at runtime if they aren't unique. ptrdiff_t count; diff --git a/app/src/ble.c b/app/src/ble.c index c850930827..f01ed87153 100644 --- a/app/src/ble.c +++ b/app/src/ble.c @@ -629,7 +629,7 @@ static void zmk_ble_ready(int err) { update_advertising(); } -static int zmk_ble_init(const struct device *_arg) { +static int zmk_ble_init(void) { int err = bt_enable(NULL); if (err) { diff --git a/app/src/combo.c b/app/src/combo.c index 5003d7f957..61671d335f 100644 --- a/app/src/combo.c +++ b/app/src/combo.c @@ -531,7 +531,7 @@ ZMK_SUBSCRIPTION(combo, zmk_keycode_state_changed); DT_INST_FOREACH_CHILD(0, COMBO_INST) -static int combo_init() { +static int combo_init(void) { k_work_init_delayable(&timeout_task, combo_timeout_handler); DT_INST_FOREACH_CHILD(0, INITIALIZE_COMBO); return 0; diff --git a/app/src/endpoints.c b/app/src/endpoints.c index dbe6bcbcd1..395d6ba502 100644 --- a/app/src/endpoints.c +++ b/app/src/endpoints.c @@ -302,7 +302,7 @@ static struct zmk_endpoint_instance get_selected_instance(void) { return instance; } -static int zmk_endpoints_init(const struct device *_arg) { +static int zmk_endpoints_init(void) { #if IS_ENABLED(CONFIG_SETTINGS) settings_subsys_init(); diff --git a/app/src/hog.c b/app/src/hog.c index 204609145c..f17f759c90 100644 --- a/app/src/hog.c +++ b/app/src/hog.c @@ -398,7 +398,7 @@ int zmk_hog_send_mouse_report(struct zmk_hid_mouse_report_body *report) { #endif // IS_ENABLED(CONFIG_ZMK_MOUSE) -int zmk_hog_init(const struct device *_arg) { +static int zmk_hog_init(void) { static const struct k_work_queue_config queue_config = {.name = "HID Over GATT Send Work"}; k_work_queue_start(&hog_work_q, hog_q_stack, K_THREAD_STACK_SIZEOF(hog_q_stack), CONFIG_ZMK_BLE_THREAD_PRIORITY, &queue_config); diff --git a/app/src/rgb_underglow.c b/app/src/rgb_underglow.c index ddc0aef1f4..a7a9b4f018 100644 --- a/app/src/rgb_underglow.c +++ b/app/src/rgb_underglow.c @@ -239,7 +239,7 @@ static void zmk_rgb_underglow_save_state_work(struct k_work *_work) { static struct k_work_delayable underglow_save_work; #endif -static int zmk_rgb_underglow_init(const struct device *_arg) { +static int zmk_rgb_underglow_init(void) { led_strip = DEVICE_DT_GET(STRIP_CHOSEN); #if IS_ENABLED(CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER) diff --git a/app/src/sensors.c b/app/src/sensors.c index b7aeba0b80..4dcda44d1d 100644 --- a/app/src/sensors.c +++ b/app/src/sensors.c @@ -140,7 +140,7 @@ static void zmk_sensors_init_item(uint8_t i) { #define SENSOR_INIT(idx, _t) zmk_sensors_init_item(idx); -static int zmk_sensors_init(const struct device *_arg) { +static int zmk_sensors_init(void) { LISTIFY(ZMK_KEYMAP_SENSORS_LEN, SENSOR_INIT, (), 0) return 0; diff --git a/app/src/split/bluetooth/central.c b/app/src/split/bluetooth/central.c index 95fd72603a..abb37a0b91 100644 --- a/app/src/split/bluetooth/central.c +++ b/app/src/split/bluetooth/central.c @@ -865,7 +865,7 @@ int zmk_split_bt_update_hid_indicator(zmk_hid_indicators_t indicators) { #endif // IS_ENABLED(CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS) -int zmk_split_bt_central_init(const struct device *_arg) { +static int zmk_split_bt_central_init(void) { k_work_queue_start(&split_central_split_run_q, split_central_split_run_q_stack, K_THREAD_STACK_SIZEOF(split_central_split_run_q_stack), CONFIG_ZMK_BLE_THREAD_PRIORITY, NULL); diff --git a/app/src/split/bluetooth/peripheral.c b/app/src/split/bluetooth/peripheral.c index dcf3db63aa..e3129ceece 100644 --- a/app/src/split/bluetooth/peripheral.c +++ b/app/src/split/bluetooth/peripheral.c @@ -146,7 +146,7 @@ bool zmk_split_bt_peripheral_is_connected(void) { return is_connected; } bool zmk_split_bt_peripheral_is_bonded(void) { return is_bonded; } -static int zmk_peripheral_ble_init(const struct device *_arg) { +static int zmk_peripheral_ble_init(void) { int err = bt_enable(NULL); if (err) { diff --git a/app/src/split/bluetooth/service.c b/app/src/split/bluetooth/service.c index d6eb7ce4b2..505eb363cd 100644 --- a/app/src/split/bluetooth/service.c +++ b/app/src/split/bluetooth/service.c @@ -265,7 +265,7 @@ int zmk_split_bt_sensor_triggered(uint8_t sensor_index, } #endif /* ZMK_KEYMAP_HAS_SENSORS */ -int service_init(const struct device *_arg) { +static int service_init(void) { static const struct k_work_queue_config queue_config = { .name = "Split Peripheral Notification Queue"}; k_work_queue_start(&service_work_q, service_q_stack, K_THREAD_STACK_SIZEOF(service_q_stack), diff --git a/app/src/usb.c b/app/src/usb.c index dbfece7656..cd78761834 100644 --- a/app/src/usb.c +++ b/app/src/usb.c @@ -65,7 +65,7 @@ void usb_status_cb(enum usb_dc_status_code status, const uint8_t *params) { k_work_submit(&usb_status_notifier_work); }; -static int zmk_usb_init(const struct device *_arg) { +static int zmk_usb_init(void) { int usb_enable_ret; usb_enable_ret = usb_enable(usb_status_cb); diff --git a/app/src/usb_hid.c b/app/src/usb_hid.c index f3542ffa4a..cd3ef92039 100644 --- a/app/src/usb_hid.c +++ b/app/src/usb_hid.c @@ -177,7 +177,7 @@ int zmk_usb_hid_send_mouse_report() { } #endif // IS_ENABLED(CONFIG_ZMK_MOUSE) -static int zmk_usb_hid_init(const struct device *_arg) { +static int zmk_usb_hid_init(void) { hid_dev = device_get_binding("HID_0"); if (hid_dev == NULL) { LOG_ERR("Unable to locate HID device"); diff --git a/app/src/workqueue.c b/app/src/workqueue.c index 1aa4f59a12..e6e55c87c1 100644 --- a/app/src/workqueue.c +++ b/app/src/workqueue.c @@ -17,7 +17,7 @@ struct k_work_q *zmk_workqueue_lowprio_work_q(void) { return &lowprio_work_q; } -static int workqueue_init(const struct device *_device) { +static int workqueue_init(void) { static const struct k_work_queue_config queue_config = {.name = "Low Priority Work Queue"}; k_work_queue_start(&lowprio_work_q, lowprio_q_stack, K_THREAD_STACK_SIZEOF(lowprio_q_stack), CONFIG_ZMK_LOW_PRIORITY_THREAD_PRIORITY, &queue_config); diff --git a/app/src/wpm.c b/app/src/wpm.c index f15de74515..182abf9541 100644 --- a/app/src/wpm.c +++ b/app/src/wpm.c @@ -71,7 +71,7 @@ void wpm_expiry_function(struct k_timer *_timer) { k_work_submit(&wpm_work); } K_TIMER_DEFINE(wpm_timer, wpm_expiry_function, NULL); -int wpm_init(const struct device *_device) { +static int wpm_init(void) { wpm_state = 0; wpm_update_counter = 0; k_timer_start(&wpm_timer, K_SECONDS(WPM_UPDATE_INTERVAL_SECONDS), |