+static void dump_name_devpath(struct udevice *udev) {
+ printf("%s=%s/%s\n", udev->devpath, udev_root, udev->name);
+}
+
+static void dump_record(struct udevice *udev) {
+ print_record(udev);
+ printf("\n");
+}
+
+static void dump_db(void fnct(struct udevice *udev)) {
+ LIST_HEAD(name_list);
+ struct name_entry *name_loop;
+
+ udev_db_get_all_entries(&name_list);
+ list_for_each_entry(name_loop, &name_list, node) {
+ struct udevice udev_db;
+
+ udev_init_device(&udev_db, NULL, NULL, NULL);
+ if (udev_db_get_device(&udev_db, name_loop->name) == 0)
+ fnct(&udev_db);
+ udev_cleanup_device(&udev_db);
+ }
+ name_list_cleanup(&name_list);
+}
+
+static void print_help(void)
+{
+ fprintf(stderr, "Usage: udevinfo [-anpqrVh]\n"
+ " -q TYPE query database for the specified value:\n"
+ " 'name' name of device node\n"
+ " 'symlink' pointing to node\n"
+ " 'path' sysfs device path\n"
+ " 'env' the device related imported environment\n"
+ " 'all' all values\n"
+ "\n"
+ " -p PATH sysfs device path used for query or chain\n"
+ " -n NAME node/symlink name used for query\n"
+ "\n"
+ " -r print udev root\n"
+ " -a print all SYSFS_attributes along the device chain\n"
+ " -d print the relationship of devpath and the node name for all\n"
+ " -e print the content of the udev database\n"
+ " -V print udev version\n"
+ " -h print this help text\n"
+ "\n");