Skip to content

Commit 2ed86eb

Browse files
keith-zephyrChromeos LUCI
authored andcommitted
zephyr: Eliminate pointer from SYS_INIT functions
The upstream change zephyrproject-rtos/zephyr#51217 modified the function signature for the SYS_INIT call, eliminating the unused device pointer. Run the Zephyr provided script ./zephyr/scripts/utils/migrate_sys_init.py to update all callers. BUG=b:278595739 BRANCH=none TEST=zmake build -a Cq-Depend: chromium:4422804 Change-Id: I881bc536cef43a7c3ac4bc5eb3ce1893237bbd1f Signed-off-by: Keith Short <[email protected]> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4437049 Reviewed-by: Tristan Honscheid <[email protected]>
1 parent 187f87a commit 2ed86eb

File tree

40 files changed

+42
-80
lines changed

40 files changed

+42
-80
lines changed

common/i2c_controller.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ BUILD_ASSERT(ARRAY_SIZE(port_mutex) < 32);
5252
static uint8_t port_protected[I2C_PORT_COUNT + I2C_BITBANG_PORT_COUNT];
5353

5454
#ifdef CONFIG_ZEPHYR
55-
static int init_port_mutex(const struct device *dev)
55+
static int init_port_mutex(void)
5656
{
57-
ARG_UNUSED(dev);
58-
5957
for (int i = 0; i < ARRAY_SIZE(port_mutex); ++i)
6058
k_mutex_init(port_mutex + i);
6159

common/mkbp_event.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,8 @@ static uint32_t mkbp_host_event_wake_mask = CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK;
8080
#endif /* CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK */
8181

8282
#ifdef CONFIG_ZEPHYR
83-
static int init_mkbp_mutex(const struct device *dev)
83+
static int init_mkbp_mutex(void)
8484
{
85-
ARG_UNUSED(dev);
86-
8785
k_mutex_init(&state.lock);
8886

8987
return 0;

common/motion_sense.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ static atomic_t odr_event_required;
7676
__maybe_unused static int fifo_int_enabled;
7777

7878
#ifdef CONFIG_ZEPHYR
79-
static int init_sensor_mutex(const struct device *dev)
79+
static int init_sensor_mutex(void)
8080
{
81-
ARG_UNUSED(dev);
82-
8381
k_mutex_init(&g_sensor_mutex);
8482

8583
return 0;

common/usbc/ap_vdm_control.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@ static struct {
5757
} ap_storage[CONFIG_USB_PD_PORT_MAX_COUNT];
5858

5959
#ifdef CONFIG_ZEPHYR
60-
static int init_ap_vdm_mutexes(const struct device *dev)
60+
static int init_ap_vdm_mutexes(void)
6161
{
6262
int port;
6363

64-
ARG_UNUSED(dev);
65-
6664
for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++) {
6765
k_mutex_init(&ap_storage[port].queue_lock);
6866
}

common/usbc/usb_pd_dpm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,10 @@ static void print_current_state(const int port)
142142
}
143143

144144
#ifdef CONFIG_ZEPHYR
145-
static int init_dpm_mutexes(const struct device *dev)
145+
static int init_dpm_mutexes(void)
146146
{
147147
int port;
148148

149-
ARG_UNUSED(dev);
150-
151149
for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++) {
152150
k_mutex_init(&dpm[port].vdm_req_mutex);
153151
}

driver/usb_mux/usb_mux.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,10 @@ extern mutex_t queue_lock[];
120120
#endif
121121

122122
#ifdef CONFIG_ZEPHYR
123-
static int init_mux_mutex(const struct device *dev)
123+
static int init_mux_mutex(void)
124124
{
125125
int port;
126126

127-
ARG_UNUSED(dev);
128127
for (port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; port++) {
129128
k_mutex_init(&mux_lock[port]);
130129

power/hibernate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ host_command_hibernation_delay(struct host_cmd_handler_args *args)
167167
DECLARE_HOST_COMMAND(EC_CMD_HIBERNATION_DELAY, host_command_hibernation_delay,
168168
EC_VER_MASK(0));
169169

170-
static int hibernate_init(const struct device *unused)
170+
static int hibernate_init(void)
171171
{
172172
static struct ap_power_ev_callback cb;
173173

zephyr/app/ec/chip/riscv/riscv-ite/it8xxx2-espi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static void espi_enable_callback(struct ap_power_ev_callback *cb,
4646
}
4747
}
4848

49-
static int init_espi_enable_callback(const struct device *unused)
49+
static int init_espi_enable_callback(void)
5050
{
5151
static struct ap_power_ev_callback cb;
5252

zephyr/drivers/cros_system/cros_system_npcx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,8 @@ DEVICE_DEFINE(cros_system_npcx_0, "CROS_SYSTEM", cros_system_npcx_init, NULL,
632632

633633
PINCTRL_DT_DEFINE(DBG_NODE);
634634

635-
static int jtag_init(const struct device *dev)
635+
static int jtag_init(void)
636636
{
637-
ARG_UNUSED(dev);
638637
struct dbg_reg *const dbg_reg_base = HAL_DBG_REG_BASE_ADDR;
639638
const struct pinctrl_dev_config *pcfg =
640639
PINCTRL_DT_DEV_CONFIG_GET(DBG_NODE);

zephyr/program/corsola/src/board_chipset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static void board_backlight_handler(struct ap_power_ev_callback *cb,
3434
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_bl_en_od), value);
3535
}
3636

37-
static int install_backlight_handler(const struct device *unused)
37+
static int install_backlight_handler(void)
3838
{
3939
static struct ap_power_ev_callback cb;
4040

0 commit comments

Comments
 (0)