From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9856846B5 for ; Mon, 16 Jan 2023 16:23:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AE57C433D2; Mon, 16 Jan 2023 16:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673886193; bh=Du52dWOz7Yvv+BLZDljMtgk4Rhvv4aaQzl4Fz4LALXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aspBEufRrlzyTS53OxTGV2PKd6+HpDJBVfICG7rKN2zxGhIiyUpqtSLeLHL9oBaWu KNxMK/+u5zr4DJ4Gxs4dP0vR6AL4xjMOrqUbky8ThPd7zbkXpyfQ3Yt/6BspCpYrJN O4hU08LMkKYusUSYwpToiuax89j+J29Gzue2GiuU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Hans de Goede , Andy Shevchenko , "Guilherme G. Piccoli" , Alexandre Belloni , Sasha Levin Subject: [PATCH 5.4 337/658] rtc: cmos: Refactor code by using the new dmi_get_bios_year() helper Date: Mon, 16 Jan 2023 16:47:05 +0100 Message-Id: <20230116154924.960315502@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154909.645460653@linuxfoundation.org> References: <20230116154909.645460653@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andy Shevchenko [ Upstream commit 604c521259c8051b7607c000eda7938f7a705d92 ] 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 Signed-off-by: Andy Shevchenko Tested-by: Guilherme G. Piccoli Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20200123131437.28157-3-andriy.shevchenko@linux.intel.com Signed-off-by: Alexandre Belloni Stable-dep-of: 83ebb7b3036d ("rtc: cmos: Disable ACPI RTC event on removal") Signed-off-by: Sasha Levin --- 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 c0dc03ffa817..60271ea2a28d 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -1200,8 +1200,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; @@ -1211,8 +1209,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.35.1