Tools: Check variable name before returning

The get_field method is used to get the instance of the variable class
by structures and unions which contain it. Previously, the method just
returned the value without checking whether or not the names matched and
therefore incorrect variable instances were being returned by structure
and enum get_field methods. Adding this string match check brings the
variable structure definition in line with other C types.

Change-Id: I3426e9f81a8d9c92eb5fe32527aceef50988c8be
Signed-off-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com>
diff --git a/tools/modules/c_struct.py b/tools/modules/c_struct.py
index 4ae865f..08c0428 100644
--- a/tools/modules/c_struct.py
+++ b/tools/modules/c_struct.py
@@ -406,6 +406,8 @@
         return [self.name]
 
     def get_field(self, field_path):
+        if field_path != self.name:
+            raise KeyError
         return self
 
     def to_bytes(self):