mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-29 14:34:09 +00:00
Use the 'real' hardware class for virtual classes like net
This commit is contained in:
parent
de9be2d34c
commit
f02571b3f3
@ -464,13 +464,28 @@ fu_udev_device_set_dev (FuUdevDevice *self, GUdevDevice *udev_device)
|
|||||||
FuUdevDevicePrivate *priv = GET_PRIVATE (self);
|
FuUdevDevicePrivate *priv = GET_PRIVATE (self);
|
||||||
#ifdef HAVE_GUDEV
|
#ifdef HAVE_GUDEV
|
||||||
const gchar *summary;
|
const gchar *summary;
|
||||||
g_autoptr(GUdevDevice) parent = NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_return_if_fail (FU_IS_UDEV_DEVICE (self));
|
g_return_if_fail (FU_IS_UDEV_DEVICE (self));
|
||||||
|
|
||||||
/* set new device */
|
#ifdef HAVE_GUDEV
|
||||||
|
/* the net subsystem is not a real hardware class */
|
||||||
|
if (udev_device != NULL &&
|
||||||
|
g_strcmp0 (g_udev_device_get_subsystem (udev_device), "net") == 0) {
|
||||||
|
g_autoptr(GUdevDevice) udev_device_phys = NULL;
|
||||||
|
udev_device_phys = g_udev_device_get_parent (udev_device);
|
||||||
|
g_set_object (&priv->udev_device, udev_device_phys);
|
||||||
|
fu_device_set_metadata (FU_DEVICE (self),
|
||||||
|
"ParentSubsystem",
|
||||||
|
g_udev_device_get_subsystem (udev_device));
|
||||||
|
} else {
|
||||||
|
g_set_object (&priv->udev_device, udev_device);
|
||||||
|
}
|
||||||
|
#else
|
||||||
g_set_object (&priv->udev_device, udev_device);
|
g_set_object (&priv->udev_device, udev_device);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* set new device */
|
||||||
if (priv->udev_device == NULL)
|
if (priv->udev_device == NULL)
|
||||||
return;
|
return;
|
||||||
#ifdef HAVE_GUDEV
|
#ifdef HAVE_GUDEV
|
||||||
@ -480,6 +495,7 @@ fu_udev_device_set_dev (FuUdevDevice *self, GUdevDevice *udev_device)
|
|||||||
/* try to get one line summary */
|
/* try to get one line summary */
|
||||||
summary = g_udev_device_get_sysfs_attr (priv->udev_device, "description");
|
summary = g_udev_device_get_sysfs_attr (priv->udev_device, "description");
|
||||||
if (summary == NULL) {
|
if (summary == NULL) {
|
||||||
|
g_autoptr(GUdevDevice) parent = NULL;
|
||||||
parent = g_udev_device_get_parent (priv->udev_device);
|
parent = g_udev_device_get_parent (priv->udev_device);
|
||||||
if (parent != NULL)
|
if (parent != NULL)
|
||||||
summary = g_udev_device_get_sysfs_attr (parent, "description");
|
summary = g_udev_device_get_sysfs_attr (parent, "description");
|
||||||
|
Loading…
Reference in New Issue
Block a user