dm: core: remove meaningless if conditional

If the variable "ret" is equal to "-ENOENT", it is trapped at [1] and
never reaches [2].  At [3], the condition "ret != -ENOENT" is always
true.

  if (ret == -ENOENT) {                       <------------------ [1]
          continue;
  } else if (ret == -ENODEV) {
          dm_dbg("Device '%s' has no compatible string\n", name);
          break;
  } else if (ret) {                           <------------------ [2]
          dm_warn("Device tree error at offset %d\n", offset);
          if (!result || ret != -ENOENT)      <------------------ [3]
                  result = ret;
          break;
  }

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Masahiro Yamada 2014-11-17 17:19:39 +09:00 committed by Simon Glass
parent cbf86d7198
commit 84a7153733
1 changed files with 1 additions and 2 deletions

View File

@ -164,8 +164,7 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset,
break;
} else if (ret) {
dm_warn("Device tree error at offset %d\n", offset);
if (!result || ret != -ENOENT)
result = ret;
result = ret;
break;
}