From f083a329e63d471a5e9238e837772b1b76c218db Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Sat, 25 Mar 2006 16:30:19 +0100 Subject: [PATCH] x86_64: Clean up and tweak ACPI blacklist year code - Move the core parser into dmi_scan.c. It can be useful for other subsystems too. - Differentiate between field doesn't exist and field is 0 or unparseable. The first case is likely an old BIOS with broken ACPI, the later is likely a slightly buggy BIOS where someone forget to edit the date. Don't blacklist in the later case. Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- drivers/acpi/blacklist.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'drivers/acpi/blacklist.c') diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 9824f679a910..f9c972b26f4f 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c @@ -77,28 +77,13 @@ static struct acpi_blacklist_item acpi_blacklist[] __initdata = { static int __init blacklist_by_year(void) { - int year; - char *s = dmi_get_system_info(DMI_BIOS_DATE); - - if (!s) - return 0; - if (!*s) - return 0; - - s = strrchr(s, '/'); - if (!s) + int year = dmi_get_year(DMI_BIOS_DATE); + /* Doesn't exist? Likely an old system */ + if (year == -1) + return 1; + /* 0? Likely a buggy new BIOS */ + if (year == 0) return 0; - - s += 1; - - year = simple_strtoul(s, NULL, 0); - - if (year < 100) { /* 2-digit year */ - year += 1900; - if (year < 1996) /* no dates < spec 1.0 */ - year += 100; - } - if (year < CONFIG_ACPI_BLACKLIST_YEAR) { printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), " "acpi=force is required to enable ACPI\n", -- cgit v1.2.3-59-g8ed1b