-static struct udev_device *lookup_device_by_name(struct udev *udev, const char *name)
-{
-#if 0
- /* FIXME */
- LIST_HEAD(name_list);
- int count;
- struct name_entry *device;
- int rc = -1;
-
- count = udev_db_get_devices_by_name(udev, name, &name_list);
- if (count <= 0)
- goto out;
-
- info(udev, "found %i devices for '%s'\n", count, name);
-
- /* select the device that seems to match */
- list_for_each_entry(device, &name_list, node) {
- struct udevice *udevice_loop;
- char filename[UTIL_PATH_SIZE];
- struct stat statbuf;
-
- udevice_loop = udev_device_init(udev);
- if (udevice_loop == NULL)
- break;
- if (udev_db_get_device(udevice_loop, device->name) != 0)
- goto next;
- info(udev, "found db entry '%s'\n", device->name);
-
- /* make sure, we don't get a link of a different device */
- util_strlcpy(filename, udev_get_dev_path(udev), sizeof(filename));
- util_strlcat(filename, "/", sizeof(filename));
- util_strlcat(filename, name, sizeof(filename));
- if (stat(filename, &statbuf) != 0)
- goto next;
- if (major(udevice_loop->devt) > 0 && udevice_loop->devt != statbuf.st_rdev) {
- info(udev, "skip '%s', dev_t doesn't match\n", udevice_loop->name);
- goto next;
- }
- rc = 0;
- *udevice = udevice_loop;
- break;
-next:
- udev_device_cleanup(udevice_loop);