===================================================================
@@ -1468,12 +1468,16 @@
int enable)
{
struct use_case_device *device;
+ long status;
if (uc_mgr->active_verb == NULL)
return -ENOENT;
device = find_device(uc_mgr, uc_mgr->active_verb, device_name, 1);
if (device == NULL)
return -ENOENT;
+ status = device_status(uc_mgr, device_name);
+ if ((!status && !enable) || (status && enable))
+ return 0;
return set_device(uc_mgr, device, enable);
}
@@ -1482,6 +1486,7 @@
int enable)
{
struct use_case_modifier *modifier;
+ long status;
if (uc_mgr->active_verb == NULL)
return -ENOENT;
@@ -1489,6 +1494,9 @@
modifier = find_modifier(uc_mgr, uc_mgr->active_verb,
modifier_name, 1);
if (modifier == NULL)
return -ENOENT;
+ status = modifier_status(uc_mgr, modifier_name);
+ if ((!status && !enable) || (status && enable))
+ return 0;
return set_modifier(uc_mgr, modifier, enable);
}