Copy more properties when doing FuUdevDevice->incorporate

We're supposed to be copying any private data derived during ->probe()
so we can create a superclass with the same attributes.
This commit is contained in:
Richard Hughes 2022-06-09 08:49:27 +01:00
parent db01004cd4
commit 4655e028a6

View File

@ -755,6 +755,7 @@ fu_udev_device_incorporate(FuDevice *self, FuDevice *donor)
FuUdevDevice *uself = FU_UDEV_DEVICE(self);
FuUdevDevice *udonor = FU_UDEV_DEVICE(donor);
FuUdevDevicePrivate *priv = GET_PRIVATE(uself);
FuUdevDevicePrivate *priv_donor = GET_PRIVATE(udonor);
g_return_if_fail(FU_IS_UDEV_DEVICE(self));
g_return_if_fail(FU_IS_UDEV_DEVICE(donor));
@ -764,7 +765,18 @@ fu_udev_device_incorporate(FuDevice *self, FuDevice *donor)
fu_udev_device_set_subsystem(uself, fu_udev_device_get_subsystem(udonor));
fu_udev_device_set_bind_id(uself, fu_udev_device_get_bind_id(udonor));
fu_udev_device_set_device_file(uself, fu_udev_device_get_device_file(udonor));
fu_udev_device_set_driver(uself, fu_udev_device_get_driver(udonor));
}
if (priv->vendor == 0x0 && priv_donor->vendor != 0x0)
priv->vendor = priv_donor->vendor;
if (priv->model == 0x0 && priv_donor->model != 0x0)
priv->model = priv_donor->model;
if (priv->subsystem_vendor == 0x0 && priv_donor->subsystem_vendor != 0x0)
priv->subsystem_vendor = priv_donor->subsystem_vendor;
if (priv->subsystem_model == 0x0 && priv_donor->subsystem_model != 0x0)
priv->subsystem_model = priv_donor->subsystem_model;
if (priv->revision == 0x0 && priv_donor->revision != 0x0)
priv->revision = priv_donor->revision;
}
/**