mirror of git://git.sysmocom.de/ofono
Refactor: modem de-registration
This commit is contained in:
parent
dac0ccc8a8
commit
6266e3f679
12
src/modem.c
12
src/modem.c
|
@ -1145,11 +1145,8 @@ static void modem_unregister(struct ofono_modem *modem)
|
||||||
{
|
{
|
||||||
DBusConnection *conn = ofono_dbus_get_connection();
|
DBusConnection *conn = ofono_dbus_get_connection();
|
||||||
|
|
||||||
if (modem->driver == NULL)
|
if (modem->powered == TRUE)
|
||||||
return;
|
set_powered(modem, FALSE);
|
||||||
|
|
||||||
remove_all_atoms(modem);
|
|
||||||
modem->call_ids = 0;
|
|
||||||
|
|
||||||
__ofono_watchlist_free(modem->atom_watches);
|
__ofono_watchlist_free(modem->atom_watches);
|
||||||
modem->atom_watches = NULL;
|
modem->atom_watches = NULL;
|
||||||
|
@ -1178,10 +1175,7 @@ static void modem_unregister(struct ofono_modem *modem)
|
||||||
|
|
||||||
g_dbus_unregister_interface(conn, modem->path, OFONO_MODEM_INTERFACE);
|
g_dbus_unregister_interface(conn, modem->path, OFONO_MODEM_INTERFACE);
|
||||||
|
|
||||||
if (modem->powered == TRUE)
|
if (modem->driver && modem->driver->remove)
|
||||||
set_powered(modem, FALSE);
|
|
||||||
|
|
||||||
if (modem->driver->remove)
|
|
||||||
modem->driver->remove(modem);
|
modem->driver->remove(modem);
|
||||||
|
|
||||||
g_hash_table_destroy(modem->properties);
|
g_hash_table_destroy(modem->properties);
|
||||||
|
|
Loading…
Reference in New Issue