aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-03-25 10:30:19 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 12:10:54 -0500
commitf083a329e63d471a5e9238e837772b1b76c218db (patch)
tree3d0955a4190ca886c3efa2e93e725d843e7d907b /drivers
parente6fc99c6aba0350a3c4c0206b7047d4893491485 (diff)
[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 <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/blacklist.c27
1 files changed, 6 insertions, 21 deletions
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 = {
77 77
78static int __init blacklist_by_year(void) 78static int __init blacklist_by_year(void)
79{ 79{
80 int year; 80 int year = dmi_get_year(DMI_BIOS_DATE);
81 char *s = dmi_get_system_info(DMI_BIOS_DATE); 81 /* Doesn't exist? Likely an old system */
82 82 if (year == -1)
83 if (!s) 83 return 1;
84 return 0; 84 /* 0? Likely a buggy new BIOS */
85 if (!*s) 85 if (year == 0)
86 return 0;
87
88 s = strrchr(s, '/');
89 if (!s)
90 return 0; 86 return 0;
91
92 s += 1;
93
94 year = simple_strtoul(s, NULL, 0);
95
96 if (year < 100) { /* 2-digit year */
97 year += 1900;
98 if (year < 1996) /* no dates < spec 1.0 */
99 year += 100;
100 }
101
102 if (year < CONFIG_ACPI_BLACKLIST_YEAR) { 87 if (year < CONFIG_ACPI_BLACKLIST_YEAR) {
103 printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), " 88 printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), "
104 "acpi=force is required to enable ACPI\n", 89 "acpi=force is required to enable ACPI\n",