[PATCH] Fix Maemo6 MCE: set state variable directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Please review.

/Daniel
From b9adfbe1db7b6f783d3bd6b98962a32161284127 Mon Sep 17 00:00:00 2001
From: Daniel Orstadius <daniel.orstadius@xxxxxxxxx>
Date: Wed, 20 Oct 2010 17:13:17 +0300
Subject: [PATCH] Fix Maemo6 MCE: set state variable directly

If the state variable is not updated until mce_signal_callback and
SetProperty(Powered) is called two times quickly, then the second
call will not generate a request to change the radio state of the
MCE if its corresponding call to adapter_powered occurs before the
first triggering of mce_signal_callback.

With this patch two calls to the MCE are executed, although there
might still be an unnecessary power cycle in that
mce_signal_callback is also triggered twice.
---
 plugins/maemo6.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/plugins/maemo6.c b/plugins/maemo6.c
index 0a1e551..3c91926 100644
--- a/plugins/maemo6.c
+++ b/plugins/maemo6.c
@@ -166,7 +166,9 @@ static void adapter_powered(struct btd_adapter *adapter, gboolean powered)
 				DBUS_TYPE_UINT32, &radio_mask,
 				DBUS_TYPE_INVALID);
 
-	if (!dbus_connection_send(conn, msg, NULL))
+	if (dbus_connection_send(conn, msg, NULL))
+		mce_bt_set = powered;
+	else
 		error("calling %s failed", MCE_RADIO_STATES_CHANGE_REQ);
 
 	dbus_message_unref(msg);
-- 
1.6.0.4


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux