static int technology_enable(struct connman_technology *technology)
{
+ int err = 0;
+ int err_dev;
+
DBG("technology %p enable", technology);
__sync_synchronize();
return -EBUSY;
if (technology->rfkill_driven == TRUE)
- return __connman_rfkill_block(technology->type, FALSE);
+ err = __connman_rfkill_block(technology->type, FALSE);
+
+ err_dev = technology_affect_devices(technology, TRUE);
- return technology_affect_devices(technology, TRUE);
+ if (technology->rfkill_driven == FALSE)
+ err = err_dev;
+
+ return err;
}
static int technology_disable(struct connman_technology *technology)
{
+ int err;
+
DBG("technology %p disable", technology);
__sync_synchronize();
if (technology->tethering == TRUE)
set_tethering(technology, FALSE);
+ err = technology_affect_devices(technology, FALSE);
+
if (technology->rfkill_driven == TRUE)
- return __connman_rfkill_block(technology->type, TRUE);
+ err = __connman_rfkill_block(technology->type, TRUE);
- return technology_affect_devices(technology, FALSE);
+ return err;
}
static DBusMessage *set_powered(struct connman_technology *technology,