All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/3] core: notify watches of already registered atoms
Date: Tue, 29 Mar 2011 14:35:00 -0500	[thread overview]
Message-ID: <4D923464.5000401@gmail.com> (raw)
In-Reply-To: <1301384910-28272-2-git-send-email-mika.liljeberg@nokia.com>

[-- Attachment #1: Type: text/plain, Size: 1672 bytes --]

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

  reply	other threads:[~2011-03-29 19:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29  7:48 [PATCH 0/3] atom watch cleanup Mika Liljeberg
2011-03-29  7:48 ` [PATCH 1/3] core: notify watches of already registered atoms Mika Liljeberg
2011-03-29 19:35   ` Denis Kenzior [this message]
2011-03-30  8:37     ` Mika.Liljeberg
2011-03-30 18:42       ` Denis Kenzior
2011-03-29  7:48 ` [PATCH 2/3] core: remove redundant code Mika Liljeberg
2011-03-29  7:48 ` [PATCH 3/3] atmodem: " Mika Liljeberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D923464.5000401@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.