summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-device.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-08-10 19:56:57 +0200
committerKay Sievers <kay@vrfy.org>2012-08-10 19:56:57 +0200
commitdbf61afb29e016fe1b4ac48312a782df1d60a3e6 (patch)
tree82e12903de297fb388c1e85b27fca627943a2f1b /src/libudev/libudev-device.c
parentc516c8d17f77a1c761447f4c40c8dfffeda2e06d (diff)
udev: export udev_device_new_from_device_id()
Diffstat (limited to 'src/libudev/libudev-device.c')
-rw-r--r--src/libudev/libudev-device.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index 98077e777d..1bef70962c 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -714,7 +714,25 @@ _public_ struct udev_device *udev_device_new_from_devnum(struct udev *udev, char
return udev_device_new_from_syspath(udev, path);
}
-struct udev_device *udev_device_new_from_id_filename(struct udev *udev, char *id)
+/**
+ * udev_device_new_from_device_id:
+ * @udev: udev library context
+ * @id: text string identifying a kernel device
+ *
+ * Create new udev device, and fill in information from the sys
+ * device and the udev database entry. The device is looked-up
+ * by a special string:
+ * b8:2 - block device major:minor
+ * c128:1 - char device major:minor
+ * n3 - network device ifindex
+ * +sound:card29 - kernel driver core subsystem:device name
+ *
+ * The initial refcount is 1, and needs to be decremented to
+ * release the resources of the udev device.
+ *
+ * Returns: a new udev device, or #NULL, if it does not exist
+ **/
+_public_ struct udev_device *udev_device_new_from_device_id(struct udev *udev, char *id)
{
char type;
int maj, min;