wsc: Convert to use IWD_MODULE

This commit is contained in:
Denis Kenzior 2019-05-22 10:01:53 -05:00
parent 4cfcb9c88d
commit 23b278ef52
3 changed files with 5 additions and 10 deletions

View File

@ -33,9 +33,6 @@ void netdev_exit(void);
void netdev_set_nl80211(struct l_genl_family *nl80211); void netdev_set_nl80211(struct l_genl_family *nl80211);
void netdev_shutdown(void); void netdev_shutdown(void);
bool wsc_init(void);
bool wsc_exit();
bool device_init(void); bool device_init(void);
void device_exit(void); void device_exit(void);

View File

@ -525,7 +525,6 @@ int main(int argc, char *argv[])
goto fail_device; goto fail_device;
station_init(); station_init();
wsc_init();
if (iwd_modules_init() < 0) if (iwd_modules_init() < 0)
goto fail_modules; goto fail_modules;
@ -537,7 +536,6 @@ int main(int argc, char *argv[])
fail_modules: fail_modules:
iwd_modules_exit(); iwd_modules_exit();
wsc_exit();
station_exit(); station_exit();
device_exit(); device_exit();
fail_device: fail_device:

View File

@ -1100,21 +1100,21 @@ static void wsc_netdev_watch(struct netdev *netdev,
} }
} }
bool wsc_init(void) static int wsc_init(void)
{ {
l_debug(""); l_debug("");
netdev_watch = netdev_watch_add(wsc_netdev_watch, NULL, NULL); netdev_watch = netdev_watch_add(wsc_netdev_watch, NULL, NULL);
l_dbus_register_interface(dbus_get_bus(), IWD_WSC_INTERFACE, l_dbus_register_interface(dbus_get_bus(), IWD_WSC_INTERFACE,
setup_wsc_interface, setup_wsc_interface,
wsc_free, false); wsc_free, false);
return true; return 0;
} }
bool wsc_exit() static void wsc_exit(void)
{ {
l_debug(""); l_debug("");
l_dbus_unregister_interface(dbus_get_bus(), IWD_WSC_INTERFACE); l_dbus_unregister_interface(dbus_get_bus(), IWD_WSC_INTERFACE);
netdev_watch_remove(netdev_watch); netdev_watch_remove(netdev_watch);
return true;
} }
IWD_MODULE(wsc, wsc_init, wsc_exit)