All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Keep modem->powered_pending up to date after set_powered.
@ 2009-09-10 16:57 Andrzej Zaborowski
  2009-09-10 21:32 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Andrzej Zaborowski @ 2009-09-10 16:57 UTC (permalink / raw)
  To: ofono

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

Without this once a request to power up the modem fails, modem.c won't
retry even when asked.
---
 src/modem.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/modem.c b/src/modem.c
index ed6f870..5e6e582 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -462,6 +462,11 @@ static int set_powered(struct ofono_modem *modem, ofono_bool_t powered)
 			err = driver->disable(modem);
 	}
 
+	if (err == 0)
+		modem->powered = powered;
+	else if (err != EINPROGRESS)
+		modem->powered_pending = modem->powered;
+
 	return err;
 }
 
@@ -472,6 +477,7 @@ static gboolean set_powered_timeout(gpointer user)
 	DBG("modem: %p", modem);
 
 	modem->timeout = 0;
+	modem->powered_pending = modem->powered;
 
 	if (modem->pending != NULL) {
 		DBusMessage *reply;
@@ -530,9 +536,6 @@ static DBusMessage *modem_set_property(DBusConnection *conn,
 			return NULL;
 		}
 
-		modem->powered = powered;
-		modem->powered_pending = powered;
-
 		g_dbus_send_reply(conn, msg, DBUS_TYPE_INVALID);
 
 		ofono_dbus_signal_property_changed(conn, modem->path,
-- 
1.6.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Keep modem->powered_pending up to date after set_powered.
  2009-09-10 16:57 [PATCH] Keep modem->powered_pending up to date after set_powered Andrzej Zaborowski
@ 2009-09-10 21:32 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2009-09-10 21:32 UTC (permalink / raw)
  To: ofono

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

Hi,

> Without this once a request to power up the modem fails, modem.c won't
> retry even when asked.

Good catch.  Patch has been applied.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-10 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-10 16:57 [PATCH] Keep modem->powered_pending up to date after set_powered Andrzej Zaborowski
2009-09-10 21:32 ` Denis Kenzior

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.