diff options
author | Alexander Mezin <mezin.alexander@gmail.com> | 2014-06-04 02:01:22 +0700 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-17 13:55:09 +0200 |
commit | 3f5dc08f5682bba2b9054ee8995e0d84fc14daad (patch) | |
tree | 1a1377d35f4e2f245e0bbe6efd92bd51fbcaf82c /drivers/acpi/battery.c | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) |
ACPI / battery: use callback for setting up quirks
Use callback for setting up quirk instead of checking return code
of dmi_check_system(). This change will allow using bat_dmi_table
for other quirks.
Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com>
Acked-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r-- | drivers/acpi/battery.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index e48fc98e71c4..9530f4478ae2 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -1106,8 +1106,15 @@ static int battery_notify(struct notifier_block *nb, return 0; } +static int battery_bix_broken_package_quirk(const struct dmi_system_id *d) +{ + battery_bix_broken_package = 1; + return 0; +} + static struct dmi_system_id bat_dmi_table[] = { { + .callback = battery_bix_broken_package_quirk, .ident = "NEC LZ750/LS", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "NEC"), @@ -1227,8 +1234,7 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) if (acpi_disabled) return; - if (dmi_check_system(bat_dmi_table)) - battery_bix_broken_package = 1; + dmi_check_system(bat_dmi_table); #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_dir = acpi_lock_battery_dir(); |