sd-device: always pass random UUID on triggering uevent

Then, this makes sd_device_trigger() a simple wrapper of
sd_device_trigger_with_uuid().
This commit is contained in:
Yu Watanabe
2025-02-26 18:07:51 +09:00
parent fde9f2bc48
commit 2c051721ec
+3 -15
View File
@@ -2692,16 +2692,7 @@ _public_ int sd_device_set_sysattr_valuef(sd_device *device, const char *sysattr
}
_public_ int sd_device_trigger(sd_device *device, sd_device_action_t action) {
const char *s;
assert_return(device, -EINVAL);
s = device_action_to_string(action);
if (!s)
return -EINVAL;
/* This uses the simple no-UUID interface of kernel < 4.13 */
return sd_device_set_sysattr_value(device, "uevent", s);
return sd_device_trigger_with_uuid(device, action, NULL);
}
_public_ int sd_device_trigger_with_uuid(
@@ -2715,10 +2706,6 @@ _public_ int sd_device_trigger_with_uuid(
assert_return(device, -EINVAL);
/* If no one wants to know the UUID, use the simple interface from pre-4.13 times */
if (!ret_uuid)
return sd_device_trigger(device, action);
s = device_action_to_string(action);
if (!s)
return -EINVAL;
@@ -2733,7 +2720,8 @@ _public_ int sd_device_trigger_with_uuid(
if (r < 0)
return r;
*ret_uuid = u;
if (ret_uuid)
*ret_uuid = u;
return 0;
}