[PATCH] technology: Enable tech if device is already powered

Alok Barsode alokbarsode at gmail.com
Fri Feb 24 06:17:59 PST 2012


From: Alok Barsode <alok.barsode at linux.intel.com>

connman_technology_add_device() calls __connman_device_enable()
but since the device is already enabled, the calls does not propagate
through to __connman_technology_enabled via connman_device_set_powered.
---
 src/technology.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/technology.c b/src/technology.c
index 4a0f9f1..22e6bb7 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -1044,8 +1044,17 @@ int __connman_technology_add_device(struct connman_device *device)
 		return -ENXIO;
 	}
 
-	if (technology->enable_persistent && !global_offlinemode)
-		__connman_device_enable(device);
+	if (technology->enable_persistent && !global_offlinemode) {
+		int err = __connman_device_enable(device);
+		/*
+		 * connman_technology_add_device() calls __connman_device_enable()
+		 * but since the device is already enabled, the calls does not
+		 * propagate through to connman_technology_enabled via
+		 * connman_device_set_powered.
+		 */
+		if (err = -EALREADY)
+			__connman_technology_enabled(type);
+	}
 	/* if technology persistent state is offline */
 	if (!technology->enable_persistent)
 		__connman_device_disable(device);
-- 
1.7.1




More information about the connman mailing list