From 19112f507173a75283d0b8e7e4ad5296c28cc58f Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Wed, 8 Dec 2010 10:40:45 +0800 Subject: [PATCH] --- yaml --- r: 223143 b: refs/heads/master c: 3151dbb04ad5a5bd6358371c0bfb457216d00205 h: refs/heads/master i: 223141: 92b1813d7207afdc80440c70eb6d5da644ad8080 223139: 40c98265cac494911bec7a1b34cd1daabb4d589d 223135: 573e910585cbe287ddd3fc4b86bab72da7b5a755 v: v3 --- [refs] | 2 +- trunk/drivers/acpi/ac.c | 46 ++++++++++++++++++++++++++--------------- trunk/drivers/acpi/ec.c | 3 --- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/[refs] b/[refs] index 824c3aaf2028..5e4dbc67854d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5dc4f898c2a0f66e2cefada6c687db82ba2fcbc +refs/heads/master: 3151dbb04ad5a5bd6358371c0bfb457216d00205 diff --git a/trunk/drivers/acpi/ac.c b/trunk/drivers/acpi/ac.c index ba9afeaa23ac..25d3aaebc10d 100644 --- a/trunk/drivers/acpi/ac.c +++ b/trunk/drivers/acpi/ac.c @@ -100,24 +100,7 @@ static const struct file_operations acpi_ac_fops = { .release = single_release, }; #endif -static int get_ac_property(struct power_supply *psy, - enum power_supply_property psp, - union power_supply_propval *val) -{ - struct acpi_ac *ac = to_acpi_ac(psy); - switch (psp) { - case POWER_SUPPLY_PROP_ONLINE: - val->intval = ac->state; - break; - default: - return -EINVAL; - } - return 0; -} -static enum power_supply_property ac_props[] = { - POWER_SUPPLY_PROP_ONLINE, -}; /* -------------------------------------------------------------------------- AC Adapter Management -------------------------------------------------------------------------- */ @@ -140,6 +123,35 @@ static int acpi_ac_get_state(struct acpi_ac *ac) return 0; } +/* -------------------------------------------------------------------------- + sysfs I/F + -------------------------------------------------------------------------- */ +static int get_ac_property(struct power_supply *psy, + enum power_supply_property psp, + union power_supply_propval *val) +{ + struct acpi_ac *ac = to_acpi_ac(psy); + + if (!ac) + return -ENODEV; + + if (acpi_ac_get_state(ac)) + return -ENODEV; + + switch (psp) { + case POWER_SUPPLY_PROP_ONLINE: + val->intval = ac->state; + break; + default: + return -EINVAL; + } + return 0; +} + +static enum power_supply_property ac_props[] = { + POWER_SUPPLY_PROP_ONLINE, +}; + #ifdef CONFIG_ACPI_PROCFS_POWER /* -------------------------------------------------------------------------- FS Interface (/proc) diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index 302b31ed31f1..372ff80b7b0c 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -934,9 +934,6 @@ static struct dmi_system_id __initdata ec_dmi_table[] = { ec_flag_msi, "MSI hardware", { DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL}, { - ec_flag_msi, "MSI hardware", { - DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR")}, NULL}, - { ec_validate_ecdt, "ASUS hardware", { DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, {},