mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-07 10:27:36 +00:00
trivial: Add fu_udev_device_get_number()
This commit is contained in:
parent
44ae2a75e4
commit
496fb826f1
@ -743,6 +743,29 @@ fu_udev_device_get_sysfs_path (FuUdevDevice *self)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fu_udev_device_get_number:
|
||||||
|
* @self: A #FuUdevDevice
|
||||||
|
*
|
||||||
|
* Gets the device number, if any.
|
||||||
|
*
|
||||||
|
* Returns: integer, 0 if the data is unavailable, or %G_MAXUINT64 if the
|
||||||
|
* feature is not available
|
||||||
|
*
|
||||||
|
* Since: 1.5.0
|
||||||
|
**/
|
||||||
|
guint64
|
||||||
|
fu_udev_device_get_number (FuUdevDevice *self)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_GUDEV
|
||||||
|
FuUdevDevicePrivate *priv = GET_PRIVATE (self);
|
||||||
|
g_return_val_if_fail (FU_IS_UDEV_DEVICE (self), 0);
|
||||||
|
if (priv->udev_device != NULL)
|
||||||
|
return fu_common_strtoull (g_udev_device_get_number (priv->udev_device));
|
||||||
|
#endif
|
||||||
|
return G_MAXUINT64;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fu_udev_device_get_vendor:
|
* fu_udev_device_get_vendor:
|
||||||
* @self: A #FuUdevDevice
|
* @self: A #FuUdevDevice
|
||||||
|
@ -66,6 +66,7 @@ guint32 fu_udev_device_get_model (FuUdevDevice *self);
|
|||||||
guint32 fu_udev_device_get_subsystem_vendor (FuUdevDevice *self);
|
guint32 fu_udev_device_get_subsystem_vendor (FuUdevDevice *self);
|
||||||
guint32 fu_udev_device_get_subsystem_model (FuUdevDevice *self);
|
guint32 fu_udev_device_get_subsystem_model (FuUdevDevice *self);
|
||||||
guint8 fu_udev_device_get_revision (FuUdevDevice *self);
|
guint8 fu_udev_device_get_revision (FuUdevDevice *self);
|
||||||
|
guint64 fu_udev_device_get_number (FuUdevDevice *self);
|
||||||
guint fu_udev_device_get_slot_depth (FuUdevDevice *self,
|
guint fu_udev_device_get_slot_depth (FuUdevDevice *self,
|
||||||
const gchar *subsystem);
|
const gchar *subsystem);
|
||||||
gboolean fu_udev_device_set_physical_id (FuUdevDevice *self,
|
gboolean fu_udev_device_set_physical_id (FuUdevDevice *self,
|
||||||
|
@ -652,6 +652,7 @@ LIBFWUPDPLUGIN_1.5.0 {
|
|||||||
fu_security_attrs_new;
|
fu_security_attrs_new;
|
||||||
fu_security_attrs_remove_all;
|
fu_security_attrs_remove_all;
|
||||||
fu_security_attrs_to_variant;
|
fu_security_attrs_to_variant;
|
||||||
|
fu_udev_device_get_number;
|
||||||
fu_udev_device_get_subsystem_model;
|
fu_udev_device_get_subsystem_model;
|
||||||
fu_udev_device_get_subsystem_vendor;
|
fu_udev_device_get_subsystem_vendor;
|
||||||
local: *;
|
local: *;
|
||||||
|
Loading…
Reference in New Issue
Block a user