chiark / gitweb /
remove remaining support for CONFIG_SYSFS_DEPRECATED
[elogind.git] / libudev / libudev-device.c
index 5d1ad9f223acb307adc65c9dec6f0af681807a1d..dffeed0b79bc95f5fbfa190cbd46205264cc2139 100644 (file)
@@ -508,20 +508,9 @@ static struct udev_device *device_new_from_parent(struct udev_device *udev_devic
        char path[UTIL_PATH_SIZE];
        const char *subdir;
 
-       /* follow "device" link in deprecated sys layout */
-       if (strncmp(udev_device->devpath, "/class/", 7) == 0 ||
-           strncmp(udev_device->devpath, "/block/", 7) == 0) {
-               util_strscpyl(path, sizeof(path), udev_device->syspath, "/device", NULL);
-               if (util_resolve_sys_link(udev_device->udev, path, sizeof(path)) == 0) {
-                       udev_device_parent = udev_device_new_from_syspath(udev_device->udev, path);
-                       if (udev_device_parent != NULL)
-                               return udev_device_parent;
-               }
-       }
-
        util_strscpy(path, sizeof(path), udev_device->syspath);
        subdir = &path[strlen(udev_get_sys_path(udev_device->udev))+1];
-       while (1) {
+       for (;;) {
                char *pos;
 
                pos = strrchr(subdir, '/');
@@ -577,6 +566,9 @@ struct udev_device *udev_device_get_parent(struct udev_device *udev_device)
  * value, and fill in information from the sys device and the udev
  * database entry.
  *
+ * If devtype is #NULL, only subsystem is checked, and any devtype will
+ * match.
+ *
  * The returned the device is not referenced. It is attached to the
  * child device, and will be cleaned up when the child device
  * is cleaned up.