From 8bc9ab6459efc2e616acea5a640112b7c0e50d11 Mon Sep 17 00:00:00 2001 From: Abhay Agarwal Date: Fri, 27 Sep 2019 12:51:07 +0900 Subject: [PATCH] Allow device to be removed when discriminant disabled Change-Id: I5aeb906656032597a6656ccceeed02706239e4e7 Signed-off-by: Abhay Agarwal --- ua-daemon/src/pm/ua-plugin-manager.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ua-daemon/src/pm/ua-plugin-manager.c b/ua-daemon/src/pm/ua-plugin-manager.c index 1146fc0..482ccf3 100644 --- a/ua-daemon/src/pm/ua-plugin-manager.c +++ b/ua-daemon/src/pm/ua-plugin-manager.c @@ -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); -- 2.7.4