diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-09-09 18:14:54 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-09-09 18:14:54 +0200 |
commit | 95d90c4fe0581d8b630c62e38591b3af960d131a (patch) | |
tree | 8f15713aa846bea364dd26351cc92f5c4f66ea31 /udev/lib/libudev-device.c | |
parent | 9b3a33a9ff9386b4af3229762fa7673e670b00e7 (diff) |
libudev: udev_device - read "driver" value
Diffstat (limited to 'udev/lib/libudev-device.c')
-rw-r--r-- | udev/lib/libudev-device.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/udev/lib/libudev-device.c b/udev/lib/libudev-device.c index 00b9440386..578afe7ec2 100644 --- a/udev/lib/libudev-device.c +++ b/udev/lib/libudev-device.c @@ -346,8 +346,15 @@ int udev_device_get_properties(struct udev_device *udev_device, const char *udev_device_get_driver(struct udev_device *udev_device) { + char driver[NAME_SIZE]; + if (udev_device == NULL) return NULL; + if (udev_device->driver != NULL) + return udev_device->driver; + if (util_get_sys_driver(udev_device->udev, udev_device->devpath, driver, sizeof(driver)) < 2) + return NULL; + udev_device->driver = strdup(driver); return udev_device->driver; } |