From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org,
"Guilherme G. Piccoli" <gpiccoli@canonical.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH v1 3/3] rtc: cmos: Refactor code by using the new dmi_get_bios_year() helper
Date: Wed, 22 Jan 2020 16:45:29 +0200 [thread overview]
Message-ID: <20200122144529.30307-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200122144529.30307-1-andriy.shevchenko@linux.intel.com>
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/rtc/rtc-cmos.c | 8 ++++----
1 file 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) { }
--
2.24.1
next prev parent reply other threads:[~2020-01-22 14:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-22 14:45 [PATCH v1 1/3] rtc: cmos: Stop using shared IRQ Andy Shevchenko
2020-01-22 14:45 ` [PATCH v1 2/3] rtc: cmos: Use predefined value for RTC IRQ on legacy x86 Andy Shevchenko
2020-01-22 14:45 ` Andy Shevchenko [this message]
2020-01-22 16:57 ` [PATCH v1 1/3] rtc: cmos: Stop using shared IRQ Hans de Goede
2020-01-22 16:58 ` Hans de Goede
2020-01-22 17:32 ` Guilherme Piccoli
2020-01-22 19:58 ` Andy Shevchenko
2020-01-22 20:05 ` Guilherme Piccoli
2020-01-23 8:08 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200122144529.30307-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=gpiccoli@canonical.com \
--cc=hdegoede@redhat.com \
--cc=linux-rtc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).