From: Len Brown Date: Tue, 20 Nov 2007 06:20:00 +0000 (-0500) Subject: Pull procfs-default into release branch X-Git-Tag: v2.6.24-rc4~107^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2e46d2e2a8e6ed17fac6154ac7e5fa7fe4efb28;p=linux-2.6 Pull procfs-default into release branch Conflicts: drivers/acpi/sbs.c Signed-off-by: Len Brown --- c2e46d2e2a8e6ed17fac6154ac7e5fa7fe4efb28 diff --cc drivers/acpi/sbs.c index 73c1ba3142,278d20f936..6045cdbe17 --- 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 }