Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262276
b: refs/heads/master
c: 9c921c2
h: refs/heads/master
v: v3
  • Loading branch information
Lan Tianyu authored and Len Brown committed Jul 14, 2011
1 parent 408ddf5 commit 0f45e14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e17fb6aa1a67afa1827ae317c3594040f055730
refs/heads/master: 9c921c22a7f33397a6774d7fa076db9b6a0fd669
7 changes: 6 additions & 1 deletion trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,16 @@ static int sysfs_add_battery(struct acpi_battery *battery)

static void sysfs_remove_battery(struct acpi_battery *battery)
{
if (!battery->bat.dev)
mutex_lock(&battery->lock);
if (!battery->bat.dev) {
mutex_unlock(&battery->lock);
return;
}

device_remove_file(battery->bat.dev, &alarm_attr);
power_supply_unregister(&battery->bat);
battery->bat.dev = NULL;
mutex_unlock(&battery->lock);
}

/*
Expand Down

0 comments on commit 0f45e14

Please sign in to comment.