From: Len Brown Date: Tue, 20 Nov 2007 06:20:00 +0000 (-0500) Subject: Pull procfs-default into release branch X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c2e46d2e2a8e6ed17fac6154ac7e5fa7fe4efb28;p=openwrt%2Fstaging%2Fblogic.git Pull procfs-default into release branch Conflicts: drivers/acpi/sbs.c Signed-off-by: Len Brown --- c2e46d2e2a8e6ed17fac6154ac7e5fa7fe4efb28 diff --cc drivers/acpi/sbs.c index 73c1ba314299,278d20f9366a..6045cdbe176b --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@@ -824,16 -817,14 +824,16 @@@ static int acpi_battery_add(struct acpi static void acpi_battery_remove(struct acpi_sbs *sbs, int id) { - if (sbs->battery[id].bat.dev) - device_remove_file(sbs->battery[id].bat.dev, &alarm_attr); - power_supply_unregister(&sbs->battery[id].bat); -#ifdef CONFIG_ACPI_PROCFS_POWER - if (sbs->battery[id].proc_entry) { - acpi_sbs_remove_fs(&(sbs->battery[id].proc_entry), - acpi_battery_dir); + struct acpi_battery *battery = &sbs->battery[id]; + + if (battery->bat.dev) { + if (battery->have_sysfs_alarm) + device_remove_file(battery->bat.dev, &alarm_attr); + power_supply_unregister(&battery->bat); } - #ifdef CONFIG_ACPI_PROCFS ++#ifdef CONFIG_ACPI_PROCFS_POWER + if (battery->proc_entry) + acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir); #endif }