From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH -v3 5/5] modem: add support to restore state when resetting the modem
Date: Mon, 06 Dec 2010 21:48:48 -0600 [thread overview]
Message-ID: <4CFDAEA0.6000408@gmail.com> (raw)
In-Reply-To: <1291402377-9211-5-git-send-email-padovan@profusion.mobi>
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
Hi Gustavo,
> @@ -488,16 +465,22 @@ static void online_cb(const struct ofono_error *error, void *data)
> DBusMessage *reply;
>
> if (error->type == OFONO_ERROR_TYPE_NO_ERROR &&
> - modem->modem_state == MODEM_STATE_OFFLINE)
> + modem->modem_state == MODEM_STATE_OFFLINE) {
> + modem_change_state(modem, MODEM_STATE_ONLINE);
This actually breaks the (yet unwritten) rule to try to return from the
method call before signaling the property changed.
Can you leave this be and add something like:
if (modem->pending == NULL)
goto out;
or something prior to this if condition?
> +
> + if (!modem->pending)
> + return;
> +
Then you can omit this
> reply = dbus_message_new_method_return(modem->pending);
> - else
> + } else {
> +
> + if (!modem->pending)
> + return;
> +
And this
> reply = __ofono_error_failed(modem->pending);
> + }
>
> __ofono_dbus_pending_reply(&modem->pending, reply);
And just add a label here...
> -
> - if (error->type == OFONO_ERROR_TYPE_NO_ERROR &&
> - modem->modem_state == MODEM_STATE_OFFLINE)
> - modem_change_state(modem, MODEM_STATE_ONLINE);
> }
>
> static void offline_cb(const struct ofono_error *error, void *data)
Regards,
-Denis
next prev parent reply other threads:[~2010-12-07 3:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 18:52 [PATCH -v3 1/5] modem: only unref pending if it is a powered pending Gustavo F. Padovan
2010-12-03 18:52 ` [PATCH -v3 2/5] modem: add ofono_modem_reset() to modem.h Gustavo F. Padovan
2010-12-03 18:52 ` [PATCH -v3 3/5] Add ofono_modem_reset() Gustavo F. Padovan
2010-12-03 18:52 ` [PATCH -v3 4/5] phonesim: Add modem reset trigger Gustavo F. Padovan
2010-12-03 18:52 ` [PATCH -v3 5/5] modem: add support to restore state when resetting the modem Gustavo F. Padovan
2010-12-07 3:48 ` Denis Kenzior [this message]
2010-12-07 18:31 ` [PATCH] " Gustavo F. Padovan
2010-12-18 1:13 ` Denis Kenzior
2010-12-07 3:00 ` [PATCH -v3 4/5] phonesim: Add modem reset trigger Denis Kenzior
2010-12-07 3:00 ` [PATCH -v3 3/5] Add ofono_modem_reset() Denis Kenzior
2010-12-07 2:58 ` [PATCH -v3 2/5] modem: add ofono_modem_reset() to modem.h Denis Kenzior
2010-12-03 21:37 ` [PATCH -v3 1/5] modem: only unref pending if it is a powered pending Gustavo F. Padovan
2010-12-03 21:40 ` [PATCH] " Gustavo F. Padovan
2010-12-07 2:57 ` Denis Kenzior
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=4CFDAEA0.6000408@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox