]> git.proxmox.com Git - fwupd.git/commitdiff
intel-usb4: Implement FuDevice->set_progress() to avoid a warning
authorRichard Hughes <richard@hughsie.com>
Mon, 20 Feb 2023 11:20:09 +0000 (11:20 +0000)
committerRichard Hughes <richard@hughsie.com>
Mon, 20 Feb 2023 14:29:48 +0000 (14:29 +0000)
plugins/intel-usb4/fu-intel-usb4-device.c

index f4b81734d769044f5494df6eadf70eef4f14628c..1f5bac834a4d99c49289b32ea968f54ada54b3a4 100644 (file)
@@ -545,6 +545,16 @@ fu_intel_usb4_device_to_string(FuDevice *device, guint idt, GString *str)
        fu_string_append_kx(str, idt, "NvmDeviceId", self->nvm_device_id);
 }
 
+static void
+fu_thunderbolt_device_set_progress(FuDevice *self, FuProgress *progress)
+{
+       fu_progress_set_id(progress, G_STRLOC);
+       fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_RESTART, 0, "detach");
+       fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_WRITE, 78, "write");
+       fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_RESTART, 22, "attach");
+       fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_BUSY, 0, "reload");
+}
+
 static void
 fu_intel_usb4_device_init(FuIntelUsb4Device *self)
 {
@@ -566,4 +576,5 @@ fu_intel_usb4_device_class_init(FuIntelUsb4DeviceClass *klass)
        klass_device->prepare_firmware = fu_intel_usb4_device_prepare_firmware;
        klass_device->write_firmware = fu_intel_usb4_device_write_firmware;
        klass_device->activate = fu_intel_usb4_device_activate;
+       klass_device->set_progress = fu_thunderbolt_device_set_progress;
 }