aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/abis.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-09-20 11:35:19 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-09-20 12:22:53 +0200
commit5831512c2c62dc3c4d7187882b0094f93b23a76c (patch)
treef096a7f1b7559ed6955e689d0049d941313b3e14 /src/common/abis.c
parenta09c9a8c3237a7ef6e07235d8b2a513ef4657826 (diff)
abis: Move FSM registration to constructor function
We commonly do it this way since there's only need to call it once at the startup of the program. Change-Id: I6ee5b89175ee32bc12a8afc9682a8f90d1713291
Diffstat (limited to 'src/common/abis.c')
-rw-r--r--src/common/abis.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/abis.c b/src/common/abis.c
index e82ac963..9b0a5b30 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -446,7 +446,6 @@ int abis_open(struct gsm_bts *bts, char *model_name)
return -EINVAL;
}
- OSMO_ASSERT(osmo_fsm_register(&abis_link_fsm) == 0);
bts->abis_link_fi = osmo_fsm_inst_alloc(&abis_link_fsm, bts, NULL, LOGL_DEBUG, "abis_link");
OSMO_ASSERT(bts->abis_link_fi);
@@ -461,3 +460,8 @@ int abis_open(struct gsm_bts *bts, char *model_name)
return 0;
}
+
+static __attribute__((constructor)) void abis_link_fsm_init(void)
+{
+ OSMO_ASSERT(osmo_fsm_register(&abis_link_fsm) == 0);
+}