From 6119c08c28072aa298f9178f937bfb03bbfe3b4d Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 14 Aug 2009 15:38:42 -0500 Subject: [PATCH] Rework ofono_modem_remove_atom Change to ofono_atom_free since the atom now carries all necessary information about the modem it is attached to --- src/modem.c | 6 ++---- src/ofono.h | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/modem.c b/src/modem.c index eb200ea..2c0d0e6 100644 --- a/src/modem.c +++ b/src/modem.c @@ -180,11 +180,9 @@ struct ofono_atom *__ofono_modem_find_atom(struct ofono_modem *modem, return NULL; } -void __ofono_modem_remove_atom(struct ofono_modem *modem, - struct ofono_atom *atom) +void __ofono_atom_free(struct ofono_atom *atom) { - if (modem == NULL) - return; + struct ofono_modem *modem = atom->modem; modem->atoms = g_slist_remove(modem->atoms, atom); diff --git a/src/ofono.h b/src/ofono.h index 34b1fda..0c03a2f 100644 --- a/src/ofono.h +++ b/src/ofono.h @@ -123,8 +123,7 @@ void __ofono_atom_register(struct ofono_atom *atom, void (*unregister)(struct ofono_atom *)); void __ofono_atom_unregister(struct ofono_atom *atom); -void __ofono_modem_remove_atom(struct ofono_modem *modem, - struct ofono_atom *atom); +void __ofono_atom_free(struct ofono_atom *atom); #include #include -- 2.7.4