On 05.06.23 11:30, Ahmad Fatoum wrote: >> I'm not completely sure which version of the code you are referencing >> here because I cannot find that context, but … > > I replied on mol's series with two fixups that should be squashed. One of them > removes *outdir, which is written, but never read.
Sorry, I was confused. Please find attached a patch that actually applies on v4. The other fixup was out-of-place. ------------------ 8< --------------------- diff --git a/src/libdt.c b/src/libdt.c index de8209ce53ae..019a7555a6f6 100644 --- a/src/libdt.c +++ b/src/libdt.c @@ -2363,7 +2363,6 @@ static struct udev_device *of_find_device_by_uuid(const char *uuid) struct udev *udev; struct udev_enumerate *enumerate; struct udev_list_entry *devices, *dev_list_entry; - int ret = 0; udev = udev_new(); if (!udev) { @@ -2376,7 +2375,7 @@ static struct udev_device *of_find_device_by_uuid(const char *uuid) udev_enumerate_scan_devices(enumerate); devices = udev_enumerate_get_list_entry(enumerate); udev_list_entry_foreach(dev_list_entry, devices) { - const char *path, *devtype, *outpath, *dev_uuid; + const char *path, *devtype, *dev_uuid; struct udev_device *device; path = udev_list_entry_get_name(dev_list_entry); @@ -2388,16 +2387,12 @@ static struct udev_device *of_find_device_by_uuid(const char *uuid) continue; if (!strcmp(devtype, "disk")) { dev_uuid = udev_device_get_property_value(device, "ID_PART_TABLE_UUID"); - if (dev_uuid && !strcasecmp(dev_uuid, uuid)) { - outpath = udev_device_get_devnode(device); + if (dev_uuid && !strcasecmp(dev_uuid, uuid)) return device; - } } else if (!strcmp(devtype, "partition")) { dev_uuid = udev_device_get_property_value(device, "ID_PART_ENTRY_UUID"); - if (dev_uuid && !strcasecmp(dev_uuid, uuid)) { - outpath = udev_device_get_devnode(device); + if (dev_uuid && !strcasecmp(dev_uuid, uuid)) return device; - } } } -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |