dm: treewide: Do not use the return value of simple uclass iterator
uclass_first_device/uclass_next_device return value will be removed,
don't use it.
With the current implementation dev is equivalent to !ret. It is
redundant to check both, ret check can be replaced with dev check, and
ret check inside the iteration is dead code.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/w1/w1-uclass.c b/drivers/w1/w1-uclass.c
index de4f25b..a4247ec 100644
--- a/drivers/w1/w1-uclass.c
+++ b/drivers/w1/w1-uclass.c
@@ -36,15 +36,10 @@
{
struct udevice *dev;
u8 family = id & 0xff;
- int ret;
- for (ret = uclass_first_device(UCLASS_W1_EEPROM, &dev);
- !ret && dev;
+ for (uclass_first_device(UCLASS_W1_EEPROM, &dev);
+ dev;
uclass_next_device(&dev)) {
- if (ret || !dev) {
- debug("cannot find w1 eeprom dev\n");
- return -ENODEV;
- }
if (dev_get_driver_data(dev) == family) {
*devp = dev;