diff options
Diffstat (limited to 'libudev')
-rw-r--r-- | libudev/libudev-device.c | 4 | ||||
-rw-r--r-- | libudev/libudev-private.h | 3 | ||||
-rw-r--r-- | libudev/libudev-util.c | 12 |
3 files changed, 4 insertions, 15 deletions
diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c index 76354dc7a7..273e5cb59c 100644 --- a/libudev/libudev-device.c +++ b/libudev/libudev-device.c @@ -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; } diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h index 157575c1ff..2873b4d2c7 100644 --- a/libudev/libudev-private.h +++ b/libudev/libudev-private.h @@ -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); diff --git a/libudev/libudev-util.c b/libudev/libudev-util.c index 48eea0b898..a600b0a881 100644 --- a/libudev/libudev-util.c +++ b/libudev/libudev-util.c @@ -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]; |