yanglint BUGFIX operations always need to be validated separately

Refs #1834
diff --git a/src/parser_data.h b/src/parser_data.h
index 15b6a8d..6250e9a 100644
--- a/src/parser_data.h
+++ b/src/parser_data.h
@@ -432,7 +432,8 @@
         struct lyd_node **diff);
 
 /**
- * @brief Validate an RPC/action request, reply, or notification.
+ * @brief Validate an RPC/action request, reply, or notification. Only the operation data tree (input/output/notif)
+ * is validate, any parents are ignored.
  *
  * @param[in,out] op_tree Operation tree with any parents. It can point to the operation itself or any of
  * its parents, only the operation subtree is actually validated.
diff --git a/tools/lint/common.c b/tools/lint/common.c
index 8819443..4fd0fa1 100644
--- a/tools/lint/common.c
+++ b/tools/lint/common.c
@@ -533,12 +533,34 @@
             default:
                 assert(0);
             }
-        } else if (oper_tree) {
-            /* additional validation of the RPC/Action/reply/Notification with the operational datastore */
-            ret = lyd_validate_op(tree, oper_tree, data_type, NULL);
+        } else {
+            /* validation of the RPC/Action/reply/Notification with the operational datastore, if any */
+            switch (data_type) {
+            case LYD_TYPE_DATA_YANG:
+                /* already validated */
+                break;
+            case LYD_TYPE_RPC_YANG:
+            case LYD_TYPE_RPC_NETCONF:
+                ret = lyd_validate_op(tree, oper_tree, LYD_TYPE_RPC_YANG, NULL);
+                break;
+            case LYD_TYPE_REPLY_YANG:
+            case LYD_TYPE_REPLY_NETCONF:
+                ret = lyd_validate_op(tree, oper_tree, LYD_TYPE_REPLY_YANG, NULL);
+                break;
+            case LYD_TYPE_NOTIF_YANG:
+            case LYD_TYPE_NOTIF_NETCONF:
+                ret = lyd_validate_op(tree, oper_tree, LYD_TYPE_NOTIF_YANG, NULL);
+                break;
+            default:
+                assert(0);
+            }
             if (ret) {
-                YLMSG_E("Failed to validate input data file \"%s\" with operational datastore \"%s\".\n",
-                        input_f->path, operational_f->path);
+                if (operational_f->path) {
+                    YLMSG_E("Failed to validate input data file \"%s\" with operational datastore \"%s\".\n",
+                            input_f->path, operational_f->path);
+                } else {
+                    YLMSG_E("Failed to validate input data file \"%s\".\n", input_f->path);
+                }
                 goto cleanup;
             }
         }