Commit fe842231 authored by Richard Hughes's avatar Richard Hughes
Browse files

unifying: Don't duplicate a device flag from FuDevice

parent d8a175ee
......@@ -53,10 +53,6 @@ fu_plugin_unifying_device_added (FuPlugin *plugin,
if (!lu_device_open (device, error))
return FALSE;
/* create new FuDevice */
if (lu_device_has_flag (device, LU_DEVICE_FLAG_CAN_FLASH))
fu_device_add_flag (FU_DEVICE (device), FWUPD_DEVICE_FLAG_UPDATABLE);
/* insert to hash */
fu_plugin_device_add (plugin, FU_DEVICE (device));
return TRUE;
......
......@@ -200,7 +200,7 @@ lu_device_bootloader_open (LuDevice *device, GError **error)
fu_device_set_name (FU_DEVICE (device), name);
/* we can flash this */
lu_device_add_flag (device, LU_DEVICE_FLAG_CAN_FLASH);
fu_device_add_flag (FU_DEVICE (device), FWUPD_DEVICE_FLAG_UPDATABLE);
/* get memory map */
req->cmd = LU_DEVICE_BOOTLOADER_CMD_GET_MEMINFO;
......
......@@ -347,7 +347,7 @@ lu_device_peripheral_probe (LuDevice *device, GError **error)
}
idx = lu_device_hidpp_feature_get_idx (device, HIDPP_FEATURE_DFU_CONTROL);
if (idx != 0x00) {
lu_device_add_flag (device, LU_DEVICE_FLAG_CAN_FLASH);
fu_device_add_flag (FU_DEVICE (device), FWUPD_DEVICE_FLAG_UPDATABLE);
lu_device_add_flag (device, LU_DEVICE_FLAG_REQUIRES_DETACH);
}
idx = lu_device_hidpp_feature_get_idx (device, HIDPP_FEATURE_DFU_CONTROL_SIGNED);
......@@ -365,14 +365,14 @@ lu_device_peripheral_probe (LuDevice *device, GError **error)
if ((msg->data[2] & 0x01) > 0) {
g_warning ("DFU mode not available");
} else {
lu_device_add_flag (device, LU_DEVICE_FLAG_CAN_FLASH);
fu_device_add_flag (FU_DEVICE (device), FWUPD_DEVICE_FLAG_UPDATABLE);
lu_device_add_flag (device, LU_DEVICE_FLAG_REQUIRES_DETACH);
lu_device_add_flag (device, LU_DEVICE_FLAG_REQUIRES_SIGNED_FIRMWARE);
}
}
idx = lu_device_hidpp_feature_get_idx (device, HIDPP_FEATURE_DFU);
if (idx != 0x00) {
lu_device_add_flag (device, LU_DEVICE_FLAG_CAN_FLASH);
fu_device_add_flag (FU_DEVICE (device), FWUPD_DEVICE_FLAG_UPDATABLE);
lu_device_add_flag (device, LU_DEVICE_FLAG_REQUIRES_ATTACH);
if (fu_device_get_version (device) == NULL) {
g_debug ("repairing device in bootloader mode");
......
......@@ -164,7 +164,7 @@ lu_device_runtime_open (LuDevice *device, GError **error)
lu_device_set_hidpp_version (device, 1.f);
/* we can flash this */
lu_device_add_flag (device, LU_DEVICE_FLAG_CAN_FLASH);
fu_device_add_flag (FU_DEVICE (device), FWUPD_DEVICE_FLAG_UPDATABLE);
/* only the bootloader can do the update */
fu_device_set_name (FU_DEVICE (device), "Unifying Receiver");
......
......@@ -121,8 +121,6 @@ lu_device_flags_to_string (LuDeviceFlags flags)
GString *str = g_string_new (NULL);
if (flags & LU_DEVICE_FLAG_REQUIRES_SIGNED_FIRMWARE)
g_string_append (str, "signed-firmware,");
if (flags & LU_DEVICE_FLAG_CAN_FLASH)
g_string_append (str, "can-flash,");
if (flags & LU_DEVICE_FLAG_REQUIRES_RESET)
g_string_append (str, "requires-reset,");
if (flags & LU_DEVICE_FLAG_ACTIVE)
......
......@@ -80,7 +80,6 @@ typedef enum {
LU_DEVICE_FLAG_NONE,
LU_DEVICE_FLAG_ACTIVE = 1 << 0,
LU_DEVICE_FLAG_IS_OPEN = 1 << 1,
LU_DEVICE_FLAG_CAN_FLASH = 1 << 2,
LU_DEVICE_FLAG_REQUIRES_SIGNED_FIRMWARE = 1 << 3,
LU_DEVICE_FLAG_REQUIRES_RESET = 1 << 4,
LU_DEVICE_FLAG_REQUIRES_ATTACH = 1 << 5,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment