- printf(" looking at device '%s':\n", dev->devpath);
- printf(" KERNEL==\"%s\"\n", dev->kernel);
- printf(" SUBSYSTEM==\"%s\"\n", dev->subsystem);
- printf(" DRIVER==\"%s\"\n", dev->driver);
- print_all_attributes(udev, dev->devpath, "ATTR");
-
- /* walk up the chain of devices */
- while (1) {
- dev = sysfs_device_get_parent(udev, dev);
- if (dev == NULL)
+ printf(" looking at device '%s':\n", udev_device_get_devpath(device));
+ printf(" KERNEL==\"%s\"\n", udev_device_get_sysname(device));
+ str = udev_device_get_subsystem(device);
+ if (str == NULL)
+ str = "";
+ printf(" SUBSYSTEM==\"%s\"\n", str);
+ str = udev_device_get_driver(device);
+ if (str == NULL)
+ str = "";
+ printf(" DRIVER==\"%s\"\n", str);
+ print_all_attributes(udev, udev_device_get_devpath(device), "ATTR");
+
+ while (device != NULL) {
+ struct udev_device *device_parent;
+
+ device_parent = udev_device_new_from_parent(device);
+ udev_device_unref(device);
+ if (device_parent == NULL)