- printf("P: %s\n", udev->devpath);
- printf("N: %s\n", udev->name);
- printf("S: %s\n", udev->symlink);
- printf("\n");
- return 0;
-}
-
-enum query_type {
- NONE,
- NAME,
- PATH,
- SYMLINK,
- ALL
-};
-
-static int print_device_chain(const char *path)
-{
- struct sysfs_class_device *class_dev;
- struct sysfs_class_device *class_dev_parent;
- struct sysfs_attribute *attr;
- struct sysfs_device *sysfs_dev;
- struct sysfs_device *sysfs_dev_parent;
- int retval = 0;
-
- /* get the class dev */
- class_dev = sysfs_open_class_device_path(path);
- if (class_dev == NULL) {
- printf("couldn't get the class device\n");
- return -1;
- }
-
- printf("\nudevinfo starts with the device the node belongs to and then walks up the\n"
- "device chain, to print for every device found, all possibly useful attributes\n"
- "in the udev key format.\n"
- "Only attributes within one device section may be used together in one rule,\n"
- "to match the device for which the node will be created.\n"
+ struct sysfs_device *dev;
+
+ printf("\n"
+ "Udevinfo starts with the device specified by the devpath and then\n"
+ "walks up the chain of parent devices. It prints for every device\n"
+ "found, all possible attributes in the udev rules key format.\n"
+ "A rule to match, can be composed by the attributes of the device\n"
+ "and the attributes from one single parent device.\n"