Skip to content

Commit

Permalink
drivers: clock_control: remove '&' when assigning `clock_control_xxx_…
Browse files Browse the repository at this point in the history
…init`

Remove address-of operator ('&') when assigning `clock_control_xxx_init`
function pointer in `DEVICE_DT_INST_DEFINE` macro.

This change aims to maintain consistency among the drivers in
`drivers/clock_control`, ensuring that all function pointer assignments
follow the same pattern.

(cherry picked from commit dc55277)

Original-Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
GitOrigin-RevId: dc55277
Change-Id: Iae973faa8b81422ae7f4bb5404a36843c66c8ce3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5666210
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
  • Loading branch information
ndrs-pst authored and Chromeos LUCI committed Jun 28, 2024
1 parent b334ba7 commit bdb2b96
Show file tree
Hide file tree
Showing 23 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion drivers/clock_control/beetle_clock_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static const struct beetle_clock_control_cfg_t beetle_cc_cfg = {
* @brief Clock Control device init
*
*/
DEVICE_DT_INST_DEFINE(0, &beetle_clock_control_init, NULL,
DEVICE_DT_INST_DEFINE(0, beetle_clock_control_init, NULL,
NULL, &beetle_cc_cfg, PRE_KERNEL_1,
CONFIG_CLOCK_CONTROL_INIT_PRIORITY,
&beetle_clock_control_api);
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_adsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ static const struct clock_control_driver_api cavs_clock_api = {
.set_rate = cavs_clock_ctrl_set_rate
};

DEVICE_DT_DEFINE(DT_NODELABEL(clkctl), &cavs_clock_ctrl_init, NULL,
DEVICE_DT_DEFINE(DT_NODELABEL(clkctl), cavs_clock_ctrl_init, NULL,
NULL, NULL, POST_KERNEL,
CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &cavs_clock_api);
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static const struct esp32_clock_config esp32_clock_config0 = {
};

DEVICE_DT_DEFINE(DT_NODELABEL(rtc),
&clock_control_esp32_init,
clock_control_esp32_init,
NULL,
NULL,
&esp32_clock_config0,
Expand Down
4 changes: 2 additions & 2 deletions drivers/clock_control/clock_control_ifx_cat1.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ static const struct clock_control_driver_api clock_control_infineon_cat1_api = {

#if DT_NODE_HAS_STATUS(DT_NODELABEL(clk_imo), okay)
DEVICE_DT_DEFINE(DT_NODELABEL(clk_imo),
&clock_control_infineon_cat1_init,
clock_control_infineon_cat1_init,
NULL,
NULL,
NULL,
Expand All @@ -725,7 +725,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(clk_imo),
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(clk_iho), okay)
DEVICE_DT_DEFINE(DT_NODELABEL(clk_iho),
&clock_control_infineon_cat1_init,
clock_control_infineon_cat1_init,
NULL,
NULL,
NULL,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_litex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,6 @@ static const struct litex_clk_device ldev_init = {
.nclkout = NCLKOUT
};

DEVICE_DT_DEFINE(DT_NODELABEL(clock0), &litex_clk_init, NULL,
DEVICE_DT_DEFINE(DT_NODELABEL(clock0), litex_clk_init, NULL,
NULL, &ldev_init, POST_KERNEL,
CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &litex_clk_api);
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_lpc11u6x.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static const struct lpc11u6x_syscon_config syscon_config = {
static struct lpc11u6x_syscon_data syscon_data;

DEVICE_DT_INST_DEFINE(0,
&lpc11u6x_syscon_init,
lpc11u6x_syscon_init,
NULL,
&syscon_data, &syscon_config,
PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_mchp_xec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ const struct xec_pcr_config pcr_xec_config = {
};

DEVICE_DT_INST_DEFINE(0,
&xec_clock_control_init,
xec_clock_control_init,
NULL,
NULL, &pcr_xec_config,
PRE_KERNEL_1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_mcux_pcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static uint32_t clocks[] = {};
}; \
\
DEVICE_DT_INST_DEFINE(inst, \
&mcux_pcc_init, \
mcux_pcc_init, \
NULL, \
NULL, &mcux_pcc##inst##_config, \
PRE_KERNEL_1, \
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_mcux_scg.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static const struct clock_control_driver_api mcux_scg_driver_api = {
};

DEVICE_DT_INST_DEFINE(0,
&mcux_scg_init,
mcux_scg_init,
NULL,
NULL, NULL,
PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_mcux_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static const struct clock_control_driver_api mcux_sim_driver_api = {
};

DEVICE_DT_DEFINE(NXP_KINETIS_SIM_NODE,
&mcux_sim_init,
mcux_sim_init,
NULL,
NULL, NULL,
PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_npcx.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ const struct npcx_pcc_config pcc_config = {
};

DEVICE_DT_INST_DEFINE(0,
&npcx_clock_control_init,
npcx_clock_control_init,
NULL,
NULL, &pcc_config,
PRE_KERNEL_1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_numaker_scc.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static int numaker_scc_init(const struct device *dev)
.core_clock = DT_INST_PROP_OR(inst, core_clock, 0), \
}; \
\
DEVICE_DT_INST_DEFINE(inst, &numaker_scc_init, NULL, NULL, &numaker_scc_config_##inst, \
DEVICE_DT_INST_DEFINE(inst, numaker_scc_init, NULL, NULL, &numaker_scc_config_##inst, \
PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &numaker_scc_api);

DT_INST_FOREACH_STATUS_OKAY(NUMICRO_SCC_INIT);
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_nxp_s32.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static const struct clock_control_driver_api nxp_s32_clock_driver_api = {
};

DEVICE_DT_INST_DEFINE(0,
&nxp_s32_clock_init,
nxp_s32_clock_init,
NULL, NULL, NULL,
PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY,
&nxp_s32_clock_driver_api);
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_renesas_ra.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,5 @@ static int clock_control_ra_init(const struct device *dev)
return 0;
}

DEVICE_DT_INST_DEFINE(0, &clock_control_ra_init, NULL, NULL, NULL, PRE_KERNEL_1,
DEVICE_DT_INST_DEFINE(0, clock_control_ra_init, NULL, NULL, NULL, PRE_KERNEL_1,
CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &ra_clock_control_driver_api);
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_rpi_pico.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,6 @@ static struct clock_control_rpi_pico_data clock_control_rpi_pico_data = {
.rosc_ph_freq = CLOCK_FREQ(rosc_ph),
};

DEVICE_DT_INST_DEFINE(0, &clock_control_rpi_pico_init, NULL, &clock_control_rpi_pico_data,
DEVICE_DT_INST_DEFINE(0, clock_control_rpi_pico_init, NULL, &clock_control_rpi_pico_data,
&clock_control_rpi_pico_config, PRE_KERNEL_1,
CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &clock_control_rpi_pico_api);
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_control_smartbond.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ static int smartbond_clocks_pm_action(const struct device *dev, enum pm_device_a
PM_DEVICE_DT_DEFINE(DT_NODELABEL(osc), smartbond_clocks_pm_action);

DEVICE_DT_DEFINE(DT_NODELABEL(osc),
&smartbond_clocks_init,
smartbond_clocks_init,
PM_DEVICE_DT_GET(DT_NODELABEL(osc)),
NULL, NULL,
PRE_KERNEL_1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ void __weak config_regulator_voltage(uint32_t hclk_freq) {}
* that the device init runs just after SOC init
*/
DEVICE_DT_DEFINE(DT_NODELABEL(rcc),
&stm32_clock_control_init,
stm32_clock_control_init,
NULL,
NULL, NULL,
PRE_KERNEL_1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_h5.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ int stm32_clock_control_init(const struct device *dev)
* that the device init runs just after SOC init
*/
DEVICE_DT_DEFINE(DT_NODELABEL(rcc),
&stm32_clock_control_init,
stm32_clock_control_init,
NULL,
NULL, NULL,
PRE_KERNEL_1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_h7.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ void HAL_RCC_CSSCallback(void)
* that the device init runs just after SOC init
*/
DEVICE_DT_DEFINE(DT_NODELABEL(rcc),
&stm32_clock_control_init,
stm32_clock_control_init,
NULL,
NULL, NULL,
PRE_KERNEL_1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_mp1.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static int stm32_clock_control_init(const struct device *dev)
* that the device init runs just after SOC init
*/
DEVICE_DT_DEFINE(DT_NODELABEL(rcc),
&stm32_clock_control_init,
stm32_clock_control_init,
NULL,
NULL, NULL,
PRE_KERNEL_1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_u5.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ int stm32_clock_control_init(const struct device *dev)
* that the device init runs just after SOC init
*/
DEVICE_DT_DEFINE(DT_NODELABEL(rcc),
&stm32_clock_control_init,
stm32_clock_control_init,
NULL,
NULL, NULL,
PRE_KERNEL_1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_wba.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ int stm32_clock_control_init(const struct device *dev)
* that the device init runs just after SOC init
*/
DEVICE_DT_DEFINE(DT_NODELABEL(rcc),
&stm32_clock_control_init,
stm32_clock_control_init,
NULL,
NULL, NULL,
PRE_KERNEL_1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static const struct stm32_clk_mux_config stm32_clk_mux_cfg_##id = { \
.pclken = STM32_CLOCK_INFO(0, DT_DRV_INST(id)) \
}; \
\
DEVICE_DT_INST_DEFINE(id, &stm32_clk_mux_init, NULL, \
DEVICE_DT_INST_DEFINE(id, stm32_clk_mux_init, NULL, \
NULL, &stm32_clk_mux_cfg_##id, \
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS,\
NULL);
Expand Down

0 comments on commit bdb2b96

Please sign in to comment.