X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udev_device.c;h=7821c91cb44a0e0d90efa797ccf7138028c97240;hp=45bb6a28765ab39cb88ed51136c53a66e1a5641d;hb=22f29307ff0df84de0c3bebc9bf523d19d673b32;hpb=e8d569b4145a358775e87058829133fa725b32fd diff --git a/udev_device.c b/udev_device.c index 45bb6a287..7821c91cb 100644 --- a/udev_device.c +++ b/udev_device.c @@ -37,7 +37,6 @@ #include "udev.h" #include "logging.h" #include "udev_utils.h" -#include "udev_sysfs.h" #include "list.h" @@ -58,7 +57,7 @@ int udev_init_device(struct udevice *udev, const char* devpath, const char *subs if (devpath) { strlcpy(udev->devpath, devpath, sizeof(udev->devpath)); - remove_trailing_char(udev->devpath, '/'); + remove_trailing_chars(udev->devpath, '/'); if (strncmp(udev->devpath, "/block/", 7) == 0) udev->type = DEV_BLOCK; @@ -103,19 +102,7 @@ int udev_init_device(struct udevice *udev, const char* devpath, const char *subs void udev_cleanup_device(struct udevice *udev) { - struct name_entry *name_loop; - struct name_entry *temp_loop; - - list_for_each_entry_safe(name_loop, temp_loop, &udev->symlink_list, node) { - list_del(&name_loop->node); - free(name_loop); - } - list_for_each_entry_safe(name_loop, temp_loop, &udev->run_list, node) { - list_del(&name_loop->node); - free(name_loop); - } - list_for_each_entry_safe(name_loop, temp_loop, &udev->env_list, node) { - list_del(&name_loop->node); - free(name_loop); - } + name_list_cleanup(&udev->symlink_list); + name_list_cleanup(&udev->run_list); + name_list_cleanup(&udev->env_list); }