trivial: Properly namespace _INTERNAL_FLAG_NO_AUTO_REMOVE

This commit is contained in:
Richard Hughes 2021-12-10 16:15:55 +00:00
parent 3822422b1e
commit 179f250b9a
6 changed files with 10 additions and 9 deletions

View File

@ -230,7 +230,7 @@ fu_device_internal_flag_to_string(FuDeviceInternalFlags flag)
return "use-parent-for-battery"; return "use-parent-for-battery";
if (flag == FU_DEVICE_INTERNAL_FLAG_USE_PROXY_FALLBACK) if (flag == FU_DEVICE_INTERNAL_FLAG_USE_PROXY_FALLBACK)
return "use-proxy-fallback"; return "use-proxy-fallback";
if (flag == FWUPD_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE) if (flag == FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)
return "no-auto-remove"; return "no-auto-remove";
return NULL; return NULL;
} }
@ -287,7 +287,7 @@ fu_device_internal_flag_from_string(const gchar *flag)
if (g_strcmp0(flag, "use-proxy-fallback") == 0) if (g_strcmp0(flag, "use-proxy-fallback") == 0)
return FU_DEVICE_INTERNAL_FLAG_USE_PROXY_FALLBACK; return FU_DEVICE_INTERNAL_FLAG_USE_PROXY_FALLBACK;
if (g_strcmp0(flag, "no-auto-remove") == 0) if (g_strcmp0(flag, "no-auto-remove") == 0)
return FWUPD_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE; return FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE;
return FU_DEVICE_INTERNAL_FLAG_UNKNOWN; return FU_DEVICE_INTERNAL_FLAG_UNKNOWN;
} }

View File

@ -401,12 +401,13 @@ typedef guint64 FuDeviceInternalFlags;
#define FU_DEVICE_INTERNAL_FLAG_USE_PROXY_FALLBACK (1ull << 18) #define FU_DEVICE_INTERNAL_FLAG_USE_PROXY_FALLBACK (1ull << 18)
/** /**
* FWUPD_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE : * FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE:
* *
* The device is not auto removed. * The device is not auto removed.
*
* Since 1.7.3 * Since 1.7.3
*/ */
#define FWUPD_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE (1llu << 19) #define FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE (1llu << 19)
/* accessors */ /* accessors */
gchar * gchar *

View File

@ -73,7 +73,7 @@ fu_plugin_thunderbolt_composite_prepare(FuPlugin *plugin, GPtrArray *devices, GE
for (guint i = 0; i < devices->len; i++) { for (guint i = 0; i < devices->len; i++) {
FuDevice *dev = g_ptr_array_index(devices, i); FuDevice *dev = g_ptr_array_index(devices, i);
if ((g_strcmp0(fu_device_get_plugin(dev), "thunderbolt") == 0) && if ((g_strcmp0(fu_device_get_plugin(dev), "thunderbolt") == 0) &&
fu_device_has_flag(dev, FWUPD_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) { fu_device_has_internal_flag(dev, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) {
return fu_thunderbolt_probe_retimer(dev, error); return fu_thunderbolt_probe_retimer(dev, error);
} }
} }
@ -86,7 +86,7 @@ fu_plugin_thunderbolt_composite_cleanup(FuPlugin *plugin, GPtrArray *devices, GE
for (guint i = 0; i < devices->len; i++) { for (guint i = 0; i < devices->len; i++) {
FuDevice *dev = g_ptr_array_index(devices, i); FuDevice *dev = g_ptr_array_index(devices, i);
if ((g_strcmp0(fu_device_get_plugin(dev), "thunderbolt") == 0) && if ((g_strcmp0(fu_device_get_plugin(dev), "thunderbolt") == 0) &&
fu_device_has_flag(dev, FWUPD_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) { fu_device_has_internal_flag(dev, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) {
return fu_thunderbolt_device_close(dev, error); return fu_thunderbolt_device_close(dev, error);
} }
} }

View File

@ -579,7 +579,7 @@ fu_thunderbolt_device_setup_retimer(FuDevice *device, GError **error)
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE); fu_device_add_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE);
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_DUAL_IMAGE); fu_device_add_flag(device, FWUPD_DEVICE_FLAG_DUAL_IMAGE);
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_INTERNAL); fu_device_add_flag(device, FWUPD_DEVICE_FLAG_INTERNAL);
fu_device_add_flag(device, FWUPD_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE); fu_device_add_internal_flag(device, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE);
vid = fu_udev_device_get_vendor(FU_UDEV_DEVICE(self)); vid = fu_udev_device_get_vendor(FU_UDEV_DEVICE(self));
if (vid == 0x0) { if (vid == 0x0) {

View File

@ -42,7 +42,7 @@ fu_udev_backend_device_remove(FuUdevBackend *self, GUdevDevice *udev_device)
device_tmp = device_tmp =
fu_backend_lookup_by_id(FU_BACKEND(self), g_udev_device_get_sysfs_path(udev_device)); fu_backend_lookup_by_id(FU_BACKEND(self), g_udev_device_get_sysfs_path(udev_device));
if (device_tmp != NULL && if (device_tmp != NULL &&
!fu_device_has_flag(device_tmp, FWUPD_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) { !fu_device_has_internal_flag(device_tmp, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) {
if (g_getenv("FWUPD_PROBE_VERBOSE") != NULL) { if (g_getenv("FWUPD_PROBE_VERBOSE") != NULL) {
g_debug("UDEV %s removed", g_udev_device_get_sysfs_path(udev_device)); g_debug("UDEV %s removed", g_udev_device_get_sysfs_path(udev_device));
} }

View File

@ -40,7 +40,7 @@ fu_usb_backend_device_removed_cb(GUsbContext *ctx, GUsbDevice *usb_device, FuBac
device_tmp = device_tmp =
fu_backend_lookup_by_id(FU_BACKEND(self), g_usb_device_get_platform_id(usb_device)); fu_backend_lookup_by_id(FU_BACKEND(self), g_usb_device_get_platform_id(usb_device));
if (device_tmp != NULL && if (device_tmp != NULL &&
!fu_device_has_flag(device_tmp, FWUPD_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) !fu_device_has_internal_flag(device_tmp, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE))
fu_backend_device_removed(backend, device_tmp); fu_backend_device_removed(backend, device_tmp);
} }