-static int device_load(struct connman_device *device)
-{
- const char *ident = __connman_profile_active_ident();
- GKeyFile *keyfile;
- GError *error = NULL;
- gchar *identifier;
- connman_bool_t powered;
-
- DBG("device %p", device);
-
- keyfile = __connman_storage_open_profile(ident);
- if (keyfile == NULL)
- return 0;
-
- identifier = g_strdup_printf("device_%s", device->name);
- if (identifier == NULL)
- goto done;
-
- powered = g_key_file_get_boolean(keyfile, identifier,
- "Powered", &error);
- if (error == NULL)
- device->powered_persistent = powered;
- g_clear_error(&error);
-
-done:
- g_free(identifier);
-
- __connman_storage_close_profile(ident, keyfile, FALSE);
-
- return 0;
-}
-
-static int device_save(struct connman_device *device)
-{
- const char *ident = __connman_profile_active_ident();
- GKeyFile *keyfile;
- gchar *identifier;
-
- DBG("device %p", device);
-
- keyfile = __connman_storage_open_profile(ident);
- if (keyfile == NULL)
- return 0;
-
- identifier = g_strdup_printf("device_%s", device->name);
- if (identifier == NULL)
- goto done;
-
- g_key_file_set_boolean(keyfile, identifier,
- "Powered", device->powered_persistent);
-
-done:
- g_free(identifier);
-
- __connman_storage_close_profile(ident, keyfile, TRUE);
-
- return 0;
-}
-
-static struct connman_storage device_storage = {
- .name = "device",
- .priority = CONNMAN_STORAGE_PRIORITY_LOW,
- .device_load = device_load,
- .device_save = device_save,
-};
-