Hi Mika, On 03/29/2011 02:48 AM, Mika Liljeberg wrote: > --- > src/modem.c | 16 +++++++++++++++- > 1 files changed, 15 insertions(+), 1 deletions(-) > > diff --git a/src/modem.c b/src/modem.c > index 655994b..d22c718 100644 > --- a/src/modem.c > +++ b/src/modem.c > @@ -271,6 +271,9 @@ unsigned int __ofono_modem_add_atom_watch(struct ofono_modem *modem, > void *data, ofono_destroy_func destroy) > { > struct atom_watch *watch; > + unsigned int id; > + GSList *l; > + struct ofono_atom *atom; > > if (notify == NULL) > return 0; > @@ -282,8 +285,19 @@ unsigned int __ofono_modem_add_atom_watch(struct ofono_modem *modem, > watch->item.destroy = destroy; > watch->item.notify_data = data; > > - return __ofono_watchlist_add_item(modem->atom_watches, > + id = __ofono_watchlist_add_item(modem->atom_watches, > (struct ofono_watchlist_item *)watch); > + > + for (l = modem->atoms; l; l = l->next) { > + atom = l->data; > + > + if (atom->type != type || atom->unregister == NULL) > + continue; > + > + notify(atom, OFONO_ATOM_WATCH_CONDITION_REGISTERED, data); > + } > + > + return id; > } > > gboolean __ofono_modem_remove_atom_watch(struct ofono_modem *modem, This patch is behavior changing. Whether this is a good idea or not I'm still undecided, though I see its merits. However, I don't see how it is fixing anything. The watches are called only upon registration (which means the driver is probed and ready). So even if you create two netreg atoms in hopes of probing the modem type, only one should ever register and this code should not be needed. Regards, -Denis