mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 14:22:13 +00:00
altos: Set the flags in the init_real so they work for the cmdline tool
This commit is contained in:
parent
b721d4326f
commit
a4e44ce39b
@ -805,7 +805,7 @@ fu_device_altos_probe (FuDeviceAltos *device, GError **error)
|
|||||||
|
|
||||||
/* now with kind and usb_device set */
|
/* now with kind and usb_device set */
|
||||||
static void
|
static void
|
||||||
fu_device_init_real (FuDeviceAltos *device)
|
fu_device_altos_init_real (FuDeviceAltos *device)
|
||||||
{
|
{
|
||||||
FuDeviceAltosPrivate *priv = GET_PRIVATE (device);
|
FuDeviceAltosPrivate *priv = GET_PRIVATE (device);
|
||||||
g_autofree gchar *devid1 = NULL;
|
g_autofree gchar *devid1 = NULL;
|
||||||
@ -836,6 +836,12 @@ fu_device_init_real (FuDeviceAltos *device)
|
|||||||
g_usb_device_get_pid (priv->usb_device));
|
g_usb_device_get_pid (priv->usb_device));
|
||||||
fu_device_add_guid (FU_DEVICE (device), devid1);
|
fu_device_add_guid (FU_DEVICE (device), devid1);
|
||||||
g_debug ("saving runtime GUID of %s", devid1);
|
g_debug ("saving runtime GUID of %s", devid1);
|
||||||
|
|
||||||
|
/* only the bootloader can do the update */
|
||||||
|
if (priv->kind != FU_DEVICE_ALTOS_KIND_BOOTLOADER) {
|
||||||
|
fu_device_add_flag (FU_DEVICE (device),
|
||||||
|
FWUPD_DEVICE_FLAG_NEEDS_BOOTLOADER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -849,7 +855,6 @@ fu_device_altos_new (GUsbDevice *usb_device)
|
|||||||
{
|
{
|
||||||
FuDeviceAltos *device;
|
FuDeviceAltos *device;
|
||||||
FuDeviceAltosPrivate *priv;
|
FuDeviceAltosPrivate *priv;
|
||||||
guint j;
|
|
||||||
const FuDeviceAltosVidPid vidpids[] = {
|
const FuDeviceAltosVidPid vidpids[] = {
|
||||||
{ 0xfffe, 0x000a, FU_DEVICE_ALTOS_KIND_BOOTLOADER },
|
{ 0xfffe, 0x000a, FU_DEVICE_ALTOS_KIND_BOOTLOADER },
|
||||||
{ 0x1d50, 0x60c6, FU_DEVICE_ALTOS_KIND_CHAOSKEY },
|
{ 0x1d50, 0x60c6, FU_DEVICE_ALTOS_KIND_CHAOSKEY },
|
||||||
@ -857,7 +862,7 @@ fu_device_altos_new (GUsbDevice *usb_device)
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* set kind */
|
/* set kind */
|
||||||
for (j = 0; vidpids[j].vid != 0x0000; j++) {
|
for (guint j = 0; vidpids[j].vid != 0x0000; j++) {
|
||||||
if (g_usb_device_get_vid (usb_device) != vidpids[j].vid)
|
if (g_usb_device_get_vid (usb_device) != vidpids[j].vid)
|
||||||
continue;
|
continue;
|
||||||
if (g_usb_device_get_pid (usb_device) != vidpids[j].pid)
|
if (g_usb_device_get_pid (usb_device) != vidpids[j].pid)
|
||||||
@ -866,7 +871,7 @@ fu_device_altos_new (GUsbDevice *usb_device)
|
|||||||
priv = GET_PRIVATE (device);
|
priv = GET_PRIVATE (device);
|
||||||
priv->kind = vidpids[j].kind;
|
priv->kind = vidpids[j].kind;
|
||||||
priv->usb_device = g_object_ref (usb_device);
|
priv->usb_device = g_object_ref (usb_device);
|
||||||
fu_device_init_real (device);
|
fu_device_altos_init_real (device);
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -79,7 +79,6 @@ fu_plugin_altos_device_added (FuPlugin *plugin,
|
|||||||
fu_device_get_version (dev_runtime));
|
fu_device_get_version (dev_runtime));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fu_device_add_flag (FU_DEVICE (dev), FWUPD_DEVICE_FLAG_NEEDS_BOOTLOADER);
|
|
||||||
g_hash_table_insert (data->devices_runtime,
|
g_hash_table_insert (data->devices_runtime,
|
||||||
g_strdup (platform_id),
|
g_strdup (platform_id),
|
||||||
g_object_ref (dev));
|
g_object_ref (dev));
|
||||||
|
Loading…
Reference in New Issue
Block a user