]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/firmware/dmi_scan.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
[linux-2.6-omap-h63xx.git] / drivers / firmware / dmi_scan.c
index 8daf4793ac32485824194af5e14f332c50fc6f26..78b989d202a35e3d0c46b05b9267c762c5e7b6cc 100644 (file)
@@ -467,6 +467,17 @@ const char *dmi_get_system_info(int field)
 }
 EXPORT_SYMBOL(dmi_get_system_info);
 
+/**
+ *     dmi_name_in_serial -    Check if string is in the DMI product serial
+ *                             information.
+ */
+int dmi_name_in_serial(const char *str)
+{
+       int f = DMI_PRODUCT_SERIAL;
+       if (dmi_ident[f] && strstr(dmi_ident[f], str))
+               return 1;
+       return 0;
+}
 
 /**
  *     dmi_name_in_vendors - Check if string is anywhere in the DMI vendor information.
@@ -571,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);