diff --git a/src/iwd.h b/src/iwd.h index 677b9987..d988b482 100644 --- a/src/iwd.h +++ b/src/iwd.h @@ -36,9 +36,6 @@ void netdev_shutdown(void); bool device_init(void); void device_exit(void); -bool station_init(void); -void station_exit(void); - bool manager_init(struct l_genl_family *in, const char *if_whitelist, const char *if_blacklist); void manager_exit(void); diff --git a/src/main.c b/src/main.c index bb1b5ff2..e91b8db5 100644 --- a/src/main.c +++ b/src/main.c @@ -524,8 +524,6 @@ int main(int argc, char *argv[]) if (!device_init()) goto fail_device; - station_init(); - if (iwd_modules_init() < 0) goto fail_modules; @@ -536,7 +534,6 @@ int main(int argc, char *argv[]) fail_modules: iwd_modules_exit(); - station_exit(); device_exit(); fail_device: netdev_exit(); diff --git a/src/station.c b/src/station.c index 36eac34c..960c701a 100644 --- a/src/station.c +++ b/src/station.c @@ -2792,7 +2792,7 @@ static void station_netdev_watch(struct netdev *netdev, } } -bool station_init(void) +static int station_init(void) { station_list = l_queue_new(); netdev_watch = netdev_watch_add(station_netdev_watch, NULL, NULL); @@ -2802,10 +2802,12 @@ bool station_init(void) return true; } -void station_exit(void) +static void station_exit(void) { l_dbus_unregister_interface(dbus_get_bus(), IWD_STATION_INTERFACE); netdev_watch_remove(netdev_watch); l_queue_destroy(station_list, NULL); station_list = NULL; } + +IWD_MODULE(station, station_init, station_exit)