summaryrefslogtreecommitdiff
path: root/include/linux/dmi.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-02-22 15:59:20 +0300
committerIngo Molnar <mingo@kernel.org>2018-02-23 10:20:30 +0300
commit492a1abd61e4b4f78c1c5804840a304a9e32da04 (patch)
tree326e956e0e6b448dffa183819cd3b474126e3a31 /include/linux/dmi.h
parent24e8db62c135e142e23bec597adb135bd6a8828f (diff)
downloadlinux-492a1abd61e4b4f78c1c5804840a304a9e32da04.tar.xz
dmi: Introduce the dmi_get_bios_year() helper function
The pattern to only extract the year portion of date is used in several places and more users may come. By using this helper they may create slightly cleaner code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> [ Minor stylistic cleanup. ] Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Jean Delvare <jdelvare@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-acpi@vger.kernel.org Cc: linux-pci@vger.kernel.org Link: http://lkml.kernel.org/r/20180222125923.57385-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/dmi.h')
-rw-r--r--include/linux/dmi.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 46e151172d95..0bade156e908 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -147,4 +147,13 @@ static inline const struct dmi_system_id *
#endif
+static inline int dmi_get_bios_year(void)
+{
+ int year;
+
+ dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL);
+
+ return year;
+}
+
#endif /* __DMI_H__ */