device: Update profile in enable_persistent callback
authorAlok Barsode <alok.barsode@linux.intel.com>
Wed, 24 Aug 2011 13:44:08 +0000 (16:44 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 25 Aug 2011 09:14:20 +0000 (11:14 +0200)
src/device.c
src/technology.c

index be184e1..155018a 100644 (file)
@@ -740,25 +740,13 @@ static int device_scan(struct connman_device *device)
 
 int __connman_device_enable_persistent(struct connman_device *device)
 {
-       int err;
-
        DBG("device %p", device);
 
        device->powered_persistent = TRUE;
 
        __connman_storage_save_device(device);
 
-       err = __connman_device_enable(device);
-       if (err == 0 || err == -EINPROGRESS) {
-               device->offlinemode = FALSE;
-               if (__connman_profile_get_offlinemode() == TRUE) {
-                       __connman_profile_set_offlinemode(FALSE, FALSE);
-
-                       __connman_profile_save_default();
-               }
-       }
-
-       return err;
+       return __connman_device_enable(device);
 }
 
 int __connman_device_disable_persistent(struct connman_device *device)
index cb065e2..2e91b41 100644 (file)
@@ -693,6 +693,11 @@ int __connman_technology_enabled(enum connman_service_type type)
                state_changed(technology);
        }
 
+       if (__connman_profile_get_offlinemode() == TRUE) {
+               __connman_profile_set_offlinemode(FALSE, FALSE);
+               __connman_profile_save_default();
+       }
+
        return 0;
 }