FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

LinkBack Thread Tools
Old 06-30-2011, 03:33 AM
Lan Tianyu
Default ACPI / Battery: Add the check before refresh sysfs in the battery_notify()

BugLink: http://bugs.launchpad.net/bugs/852406

In the commit 25be5821, add the refresh sysfs when system resumes
from suspending. But it didn't check that the battery exists. This
will cause battery sysfs files added when the battery doesn't exist.
This patch add the check before refreshing.


Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
(cherry picked from commit 6e17fb6aa1a67afa1827ae317c3594040f055730)

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/acpi/battery.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 929f5e8..1cf8434 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -949,8 +949,10 @@ static int battery_notify(struct notifier_block *nb,
switch (mode) {
- sysfs_remove_battery(battery);
- sysfs_add_battery(battery);
+ if (battery->bat.dev) {
+ sysfs_remove_battery(battery);
+ sysfs_add_battery(battery);
+ }


kernel-team mailing list

Thread Tools

All times are GMT. The time now is 02:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org