Allow device to be removed when discriminant disabled accepted/tizen/unified/20190929.221439 submit/tizen/20190927.055416
authorAbhay Agarwal <ay.agarwal@samsung.com>
Fri, 27 Sep 2019 03:51:07 +0000 (12:51 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Fri, 27 Sep 2019 05:42:17 +0000 (14:42 +0900)
Change-Id: I5aeb906656032597a6656ccceeed02706239e4e7
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
ua-daemon/src/pm/ua-plugin-manager.c

index 1146fc0..482ccf3 100644 (file)
@@ -422,6 +422,7 @@ int _uam_pm_unregister_device(unsigned short user_id, const uam_device_info_s *d
        int id;
        uam_sensor_plugin_info_t *plugin;
        uas_device_info_t *device = NULL;
+       int ret;
 
        retv_if(NULL == dev, UAM_ERROR_INVALID_PARAMETER);
 
@@ -436,9 +437,9 @@ int _uam_pm_unregister_device(unsigned short user_id, const uam_device_info_s *d
        retv_if(NULL == device, UAM_ERROR_INTERNAL);
        device->user_id = user_id;
 
-       if (UAS_STATUS_SUCCESS != plugin->api->remove_device(device)) {
+       ret = plugin->api->remove_device(device);
+       if (UAS_STATUS_SUCCESS != ret && UAS_STATUS_ALREADY_DONE != ret) {
                UAM_ERR("plugin->remove_device() failed");
-               return UAM_ERROR_INTERNAL;
        }
 
        _pm_util_uas_device_info_free(device);