From patchwork Thu Feb 22 12:59:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10235513 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F21B60224 for ; Thu, 22 Feb 2018 13:00:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C29B28C77 for ; Thu, 22 Feb 2018 13:00:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5669528CC8; Thu, 22 Feb 2018 13:00:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E54428C98 for ; Thu, 22 Feb 2018 13:00:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932510AbeBVM7b (ORCPT ); Thu, 22 Feb 2018 07:59:31 -0500 Received: from mga17.intel.com ([192.55.52.151]:16589 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932502AbeBVM73 (ORCPT ); Thu, 22 Feb 2018 07:59:29 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Feb 2018 04:59:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,377,1515484800"; d="scan'208";a="29845355" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 22 Feb 2018 04:59:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id EEA8BF8; Thu, 22 Feb 2018 14:59:23 +0200 (EET) From: Andy Shevchenko To: Bjorn Helgaas , linux-pci@vger.kernel.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Jean Delvare , linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 1/4] dmi: Introduce dmi_get_bios_year() helper Date: Thu, 22 Feb 2018 14:59:20 +0200 Message-Id: <20180222125923.57385-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.16.1 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's used in several places and more users may come. By using this helper they may create a slightly cleaner code. Signed-off-by: Andy Shevchenko --- include/linux/dmi.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 46e151172d95..241c27008c70 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -147,4 +147,11 @@ 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__ */