diff options
author | Alok Barsode <alok.barsode@linux.intel.com> | 2012-02-24 16:17:59 +0200 |
---|---|---|
committer | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2012-03-01 13:45:25 +0100 |
commit | e22e1747723cbd9f835f2bdb903f2372f0bdd486 (patch) | |
tree | 7522915ef38afec1c3b7d537252b8d7fa257fd4c | |
parent | 02e24d57300da7571990d066d7e14bb56bdfc2c7 (diff) | |
download | connman-e22e1747723cbd9f835f2bdb903f2372f0bdd486.tar.gz connman-e22e1747723cbd9f835f2bdb903f2372f0bdd486.tar.bz2 connman-e22e1747723cbd9f835f2bdb903f2372f0bdd486.zip |
technology: Enable tech if device is already powered
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.
-rw-r--r-- | src/technology.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/technology.c b/src/technology.c index 4a0f9f16..91308a17 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); |