+static int test_device_parents(struct udev *udev, const char *devpath)
+{
+ struct udev_device *device;
+
+ printf("looking at device: %s\n", devpath);
+ device = udev_device_new_from_devpath(udev, devpath);
+ while (device != NULL) {
+ struct udev_device *device_parent;
+
+ print_device(device);
+ device_parent = udev_device_new_from_parent(device);
+ udev_device_unref(device);
+ device = device_parent;
+ }
+ return 0;
+}
+