data tree BUGFIX avoid dead code
diff --git a/src/tree_data.c b/src/tree_data.c
index dbb5c94..7f6ae8f 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -321,7 +321,6 @@
     assert(ctx && (parent || first_p));
 
     format = lyd_parse_get_format(in, format);
-    LY_CHECK_ARG_RET(ctx, format, LY_EINVAL);
     if (first_p) {
         *first_p = NULL;
     }
@@ -341,8 +340,8 @@
         rc = lyd_parse_lyb(ctx, parent, first_p, in, parse_opts, val_opts, LYD_TYPE_YANG_DATA, &parsed, &lydctx);
         break;
     case LYD_UNKNOWN:
-        LOGINT(ctx);
-        rc = LY_EINT;
+        LOGARG(ctx, format);
+        rc = LY_EINVAL;
         break;
     }
     LY_CHECK_GOTO(rc, cleanup);
@@ -458,7 +457,6 @@
     }
 
     format = lyd_parse_get_format(in, format);
-    LY_CHECK_ARG_RET(ctx, format, LY_EINVAL);
 
     /* remember input position */
     in->func_start = in->current;
@@ -484,8 +482,8 @@
         rc = lyd_parse_lyb(ctx, parent, &first, in, parse_opts, val_opts, data_type, &parsed, &lydctx);
         break;
     case LYD_UNKNOWN:
-        LOGINT(ctx);
-        rc = LY_EINT;
+        LOGARG(ctx, format);
+        rc = LY_EINVAL;
         break;
     }
     LY_CHECK_GOTO(rc, cleanup);