mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-30 18:44:53 +00:00
trivial: Provide a FuUdevDevice:probe()
Objects deriving from FuUdevDevice() like FuNvmeDevice typically want to do FuDevice->FuUdevDevice->FuNvmeDevice rather than FuDevice->FuNvmeDevice. This matches what FuUsbDevice does.
This commit is contained in:
parent
1263446b23
commit
13c9ffc322
@ -86,6 +86,7 @@ fu_udev_device_read_uint16 (const gchar *str)
|
|||||||
static gboolean
|
static gboolean
|
||||||
fu_udev_device_probe (FuDevice *device, GError **error)
|
fu_udev_device_probe (FuDevice *device, GError **error)
|
||||||
{
|
{
|
||||||
|
FuUdevDeviceClass *klass = FU_UDEV_DEVICE_GET_CLASS (device);
|
||||||
FuUdevDevice *self = FU_UDEV_DEVICE (device);
|
FuUdevDevice *self = FU_UDEV_DEVICE (device);
|
||||||
FuUdevDevicePrivate *priv = GET_PRIVATE (self);
|
FuUdevDevicePrivate *priv = GET_PRIVATE (self);
|
||||||
const gchar *tmp;
|
const gchar *tmp;
|
||||||
@ -163,6 +164,12 @@ fu_udev_device_probe (FuDevice *device, GError **error)
|
|||||||
fu_device_add_guid (device, devid);
|
fu_device_add_guid (device, devid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* subclassed */
|
||||||
|
if (klass->probe != NULL) {
|
||||||
|
if (!klass->probe (self, error))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* success */
|
/* success */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,8 @@ G_DECLARE_DERIVABLE_TYPE (FuUdevDevice, fu_udev_device, FU, UDEV_DEVICE, FuDevic
|
|||||||
struct _FuUdevDeviceClass
|
struct _FuUdevDeviceClass
|
||||||
{
|
{
|
||||||
FuDeviceClass parent_class;
|
FuDeviceClass parent_class;
|
||||||
|
gboolean (*probe) (FuUdevDevice *device,
|
||||||
|
GError **error);
|
||||||
gpointer __reserved[31];
|
gpointer __reserved[31];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user