chiark / gitweb /
libudev: util_get_sys_(subsystem,driver}() -> util_get_sys_core_link_value()
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 17 Aug 2011 19:03:05 +0000 (21:03 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 17 Aug 2011 19:03:05 +0000 (21:03 +0200)
libudev/libudev-device.c
libudev/libudev-private.h
libudev/libudev-util.c

index 76354dc..273e5cb 100644 (file)
@@ -229,7 +229,7 @@ UDEV_EXPORT const char *udev_device_get_driver(struct udev_device *udev_device)
                return NULL;
        if (!udev_device->driver_set) {
                udev_device->driver_set = true;
-               if (util_get_sys_driver(udev_device->udev, udev_device->syspath, driver, sizeof(driver)) > 0)
+               if (util_get_sys_core_link_value(udev_device->udev, "driver", udev_device->syspath, driver, sizeof(driver)) > 0)
                        udev_device->driver = strdup(driver);
        }
        return udev_device->driver;
@@ -305,7 +305,7 @@ UDEV_EXPORT const char *udev_device_get_subsystem(struct udev_device *udev_devic
        if (!udev_device->subsystem_set) {
                udev_device->subsystem_set = true;
                /* read "subsystem" link */
-               if (util_get_sys_subsystem(udev_device->udev, udev_device->syspath, subsystem, sizeof(subsystem)) > 0) {
+               if (util_get_sys_core_link_value(udev_device->udev, "subsystem", udev_device->syspath, subsystem, sizeof(subsystem)) > 0) {
                        udev_device_set_subsystem(udev_device, subsystem);
                        return udev_device->subsystem;
                }
index 157575c..2873b4d 100644 (file)
@@ -172,8 +172,7 @@ int udev_queue_export_device_failed(struct udev_queue_export *udev_queue_export,
 #define UTIL_NAME_SIZE                         512
 #define UTIL_LINE_SIZE                         16384
 #define UDEV_ALLOWED_CHARS_INPUT               "/ $%?,"
-ssize_t util_get_sys_subsystem(struct udev *udev, const char *syspath, char *subsystem, size_t size);
-ssize_t util_get_sys_driver(struct udev *udev, const char *syspath, char *driver, size_t size);
+ssize_t util_get_sys_core_link_value(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size);
 int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size);
 int util_log_priority(const char *priority);
 size_t util_path_encode(const char *src, char *dest, size_t size);
index 48eea0b..a600b0a 100644 (file)
@@ -24,7 +24,7 @@
 #include "libudev.h"
 #include "libudev-private.h"
 
-static ssize_t get_sys_link(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size)
+ssize_t util_get_sys_core_link_value(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size)
 {
        char path[UTIL_PATH_SIZE];
        char target[UTIL_PATH_SIZE];
@@ -44,16 +44,6 @@ static ssize_t get_sys_link(struct udev *udev, const char *slink, const char *sy
        return util_strscpy(value, size, pos);
 }
 
-ssize_t util_get_sys_subsystem(struct udev *udev, const char *syspath, char *subsystem, size_t size)
-{
-       return get_sys_link(udev, "subsystem", syspath, subsystem, size);
-}
-
-ssize_t util_get_sys_driver(struct udev *udev, const char *syspath, char *driver, size_t size)
-{
-       return get_sys_link(udev, "driver", syspath, driver, size);
-}
-
 int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size)
 {
        char link_target[UTIL_PATH_SIZE];