Commit 604c5212 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Alexandre Belloni

rtc: cmos: Refactor code by using the new dmi_get_bios_year() helper

Refactor code by using the new dmi_get_bios_year() helper instead of
open coding its functionality. This also makes logic slightly clearer.

No changes intended.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarGuilherme G. Piccoli <gpiccoli@canonical.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20200123131437.28157-3-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 5848ad2f
......@@ -1197,8 +1197,6 @@ static void rtc_wake_off(struct device *dev)
/* Enable use_acpi_alarm mode for Intel platforms no earlier than 2015 */
static void use_acpi_alarm_quirks(void)
{
int year;
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
return;
......@@ -1208,7 +1206,9 @@ static void use_acpi_alarm_quirks(void)
if (!is_hpet_enabled())
return;
if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year >= 2015)
if (dmi_get_bios_year() < 2015)
return;
use_acpi_alarm = true;
}
#else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment