trivial: Further simplify the fake DFU runtime logic

This commit is contained in:
Richard Hughes 2018-08-28 15:33:43 +01:00
parent 245b595f45
commit 201d0cce54

View File

@ -457,8 +457,8 @@ dfu_device_add_targets (DfuDevice *device, GError **error)
}
/* the device has no DFU runtime, so cheat */
if (priv->targets->len == 0) {
if (priv->quirks & DFU_DEVICE_QUIRK_NO_DFU_RUNTIME) {
if (priv->targets->len == 0 &&
priv->quirks & DFU_DEVICE_QUIRK_NO_DFU_RUNTIME) {
g_debug ("no DFU runtime, so faking device");
priv->state = DFU_STATE_APP_IDLE;
priv->iface_number = 0xff;
@ -467,7 +467,6 @@ dfu_device_add_targets (DfuDevice *device, GError **error)
priv->runtime_release = g_usb_device_get_release (usb_device);
priv->attributes = DFU_DEVICE_ATTRIBUTE_CAN_DOWNLOAD |
DFU_DEVICE_ATTRIBUTE_CAN_UPLOAD;
}
return TRUE;
}