Commit 3f5dc08f authored by Alexander Mezin's avatar Alexander Mezin Committed by Rafael J. Wysocki

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: default avatarAlexander Mezin <mezin.alexander@gmail.com>
Acked-by: default avatarLan Tianyu <tianyu.lan@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 7171511e
...@@ -1106,8 +1106,15 @@ static int battery_notify(struct notifier_block *nb, ...@@ -1106,8 +1106,15 @@ static int battery_notify(struct notifier_block *nb,
return 0; 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[] = { static struct dmi_system_id bat_dmi_table[] = {
{ {
.callback = battery_bix_broken_package_quirk,
.ident = "NEC LZ750/LS", .ident = "NEC LZ750/LS",
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "NEC"), DMI_MATCH(DMI_SYS_VENDOR, "NEC"),
...@@ -1227,8 +1234,7 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) ...@@ -1227,8 +1234,7 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
if (acpi_disabled) if (acpi_disabled)
return; return;
if (dmi_check_system(bat_dmi_table)) dmi_check_system(bat_dmi_table);
battery_bix_broken_package = 1;
#ifdef CONFIG_ACPI_PROCFS_POWER #ifdef CONFIG_ACPI_PROCFS_POWER
acpi_battery_dir = acpi_lock_battery_dir(); acpi_battery_dir = acpi_lock_battery_dir();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment