aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/dmi_scan.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 4a597d8c2f70..78b989d202a3 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -582,3 +582,19 @@ int dmi_walk(void (*decode)(const struct dmi_header *))
582 return 0; 582 return 0;
583} 583}
584EXPORT_SYMBOL_GPL(dmi_walk); 584EXPORT_SYMBOL_GPL(dmi_walk);
585
586/**
587 * dmi_match - compare a string to the dmi field (if exists)
588 *
589 * Returns true if the requested field equals to the str (including NULL).
590 */
591bool dmi_match(enum dmi_field f, const char *str)
592{
593 const char *info = dmi_get_system_info(f);
594
595 if (info == NULL || str == NULL)
596 return info == str;
597
598 return !strcmp(info, str);
599}
600EXPORT_SYMBOL_GPL(dmi_match);