]> err.no Git - systemd/commitdiff
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 76354dc7a7b7b178feb0575cc4f05202e56b1cb4..273e5cb59c97e8eb4482e2e43f57162aced55640 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 157575c1ff824d579a2eec6b99b4514eb5edd272..2873b4d2c7ec09c0da9a7a3e1772c3302dfd4012 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 48eea0b8981282bd25d692de973293910be4c6f3..a600b0a8812b88906ad9dcddebef3afe40ecceb5 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];