From: Denis Kenzior Date: Wed, 2 Dec 2009 21:43:08 +0000 (-0600) Subject: Fix: unregister modem when unregistering driver X-Git-Tag: 0.13~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b787745b009e500dcd94cd718021b0fea4cdfa11;p=platform%2Fupstream%2Fofono.git Fix: unregister modem when unregistering driver --- diff --git a/src/modem.c b/src/modem.c index ec723e5..012c249 100644 --- a/src/modem.c +++ b/src/modem.c @@ -1219,7 +1219,19 @@ int ofono_modem_driver_register(const struct ofono_modem_driver *d) void ofono_modem_driver_unregister(const struct ofono_modem_driver *d) { + GSList *l; + struct ofono_modem *modem; + DBG("driver: %p, name: %s", d, d->name); g_driver_list = g_slist_remove(g_driver_list, (void *)d); + + for (l = g_modem_list; l; l = l->next) { + modem = l->data; + + if (modem->driver != d) + continue; + + modem_unregister(modem); + } }