]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/firmware/dmi_scan.c
DMI: add dmi_match
[linux-2.6-omap-h63xx.git] / drivers / firmware / dmi_scan.c
index 4a597d8c2f708ae4bb0e52a7c16a4fe0a0891092..78b989d202a35e3d0c46b05b9267c762c5e7b6cc 100644 (file)
@@ -582,3 +582,19 @@ int dmi_walk(void (*decode)(const struct dmi_header *))
        return 0;
 }
 EXPORT_SYMBOL_GPL(dmi_walk);
+
+/**
+ * dmi_match - compare a string to the dmi field (if exists)
+ *
+ * Returns true if the requested field equals to the str (including NULL).
+ */
+bool dmi_match(enum dmi_field f, const char *str)
+{
+       const char *info = dmi_get_system_info(f);
+
+       if (info == NULL || str == NULL)
+               return info == str;
+
+       return !strcmp(info, str);
+}
+EXPORT_SYMBOL_GPL(dmi_match);