diff options
author | Corentin Chary <corentin.chary@gmail.com> | 2012-03-20 12:53:13 +0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2012-03-26 23:05:49 +0400 |
commit | 7a61d0207465e41b7dbe3a25f628ddef24572c6f (patch) | |
tree | 7db480395c0668f64d94a5656f8b4d2e730c514c /drivers/platform/x86 | |
parent | c55d995dd3cebffdeb2b7eff8acc813c56d62c97 (diff) | |
download | linux-7a61d0207465e41b7dbe3a25f628ddef24572c6f.tar.xz |
eeepc-wmi: split et2012 specific hacks
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/eeepc-wmi.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c index 0bb0aaf43aba..656761380342 100644 --- a/drivers/platform/x86/eeepc-wmi.c +++ b/drivers/platform/x86/eeepc-wmi.c @@ -109,26 +109,32 @@ static struct quirk_entry quirk_asus_et2012_type3 = { static struct quirk_entry *quirks; +static void et2012_quirks(void) +{ + const struct dmi_device *dev = NULL; + char oemstring[30]; + + while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { + if (sscanf(dev->name, "AEMS%24c", oemstring) == 1) { + if (oemstring[18] == '1') + quirks = &quirk_asus_et2012_type1; + else if (oemstring[18] == '3') + quirks = &quirk_asus_et2012_type3; + break; + } + } +} + static int dmi_matched(const struct dmi_system_id *dmi) { char *model; + quirks = dmi->driver_data; model = (char *)dmi->matches[1].substr; - if (unlikely(strncmp(model, "ET2012", 6) == 0)) { - const struct dmi_device *dev = NULL; - char oemstring[30]; - while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, - NULL, dev))) { - if (sscanf(dev->name, "AEMS%24c", oemstring) == 1) { - if (oemstring[18] == '1') - quirks = &quirk_asus_et2012_type1; - else if (oemstring[18] == '3') - quirks = &quirk_asus_et2012_type3; - break; - } - } - } + if (unlikely(strncmp(model, "ET2012", 6) == 0)) + et2012_quirks(); + return 1; } |