aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2020-01-23 15:14:37 +0200
committerAlexandre Belloni <[email protected]>2020-01-25 21:55:14 +0100
commit604c521259c8051b7607c000eda7938f7a705d92 (patch)
treeb4e8ff4c1cbf27c4a1fd179c857af3e20d372f81
parent5848ad2f1bcbb1bfbf3db3ee1a51fa5d0994ead6 (diff)
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 <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Guilherme G. Piccoli <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
-rw-r--r--drivers/rtc/rtc-cmos.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index aee55b658f85..b795fe4cbd2e 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -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,8 +1206,10 @@ static void use_acpi_alarm_quirks(void)
if (!is_hpet_enabled())
return;
- if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year >= 2015)
- use_acpi_alarm = true;
+ if (dmi_get_bios_year() < 2015)
+ return;
+
+ use_acpi_alarm = true;
}
#else
static inline void use_acpi_alarm_quirks(void) { }