rendered paste bodyIndex: include/linux/battery.h===================================================================RCS file: /cvs/linux/kernel26/include/linux/battery.h,vretrieving revision 1.15diff -u -r1.15 battery.h--- include/linux/battery.h 12 Apr 2007 11:29:40 -0000 1.15+++ include/linux/battery.h 17 Apr 2007 10:39:53 -0000@@ -62,6 +62,8 @@ struct power_supplicant pst; #ifdef CONFIG_LEDS_TRIGGERS+ struct led_trigger *charging_full_trig;+ char *charging_full_trig_name; struct led_trigger *charging_trig; char *charging_trig_name; struct led_trigger *full_trig;Index: drivers/hwmon/battery/battery.c===================================================================RCS file: /cvs/linux/kernel26/drivers/hwmon/battery/battery.c,vretrieving revision 1.26diff -u -r1.26 battery.c--- drivers/hwmon/battery/battery.c 13 Apr 2007 17:43:24 -0000 1.26+++ drivers/hwmon/battery/battery.c 17 Apr 2007 10:39:53 -0000@@ -59,14 +59,17 @@ switch(bat->get_status(bat)) { case BATTERY_STATUS_FULL:+ led_trigger_event(bat->charging_full_trig, LED_FULL); led_trigger_event(bat->charging_trig, LED_OFF); led_trigger_event(bat->full_trig, LED_FULL); break; case BATTERY_STATUS_CHARGING:+ led_trigger_event(bat->charging_full_trig, LED_FULL); led_trigger_event(bat->charging_trig, LED_FULL); led_trigger_event(bat->full_trig, LED_OFF); break; default:+ led_trigger_event(bat->charging_full_trig, LED_OFF); led_trigger_event(bat->charging_trig, LED_OFF); led_trigger_event(bat->full_trig, LED_OFF); break;@@ -212,6 +215,13 @@ goto power_supplicant_failed; #ifdef CONFIG_LEDS_TRIGGERS+ bat->charging_full_trig_name = kmalloc(strlen(bat->name) ++ sizeof("-charging-or-full"), GFP_KERNEL);+ if (!bat->charging_full_trig_name) {+ rc = -ENOMEM;+ goto charging_full_trig_name_failed;+ }+ bat->charging_trig_name = kmalloc(strlen(bat->name) + sizeof("-charging"), GFP_KERNEL); if (!bat->charging_trig_name) {@@ -226,11 +236,15 @@ goto full_trig_name_failed; } + strcpy(bat->charging_full_trig_name, bat->name);+ strcat(bat->charging_full_trig_name, "-charging-or-full"); strcpy(bat->charging_trig_name, bat->name); strcat(bat->charging_trig_name, "-charging"); strcpy(bat->full_trig_name, bat->name); strcat(bat->full_trig_name, "-full"); + led_trigger_register_simple(bat->charging_full_trig_name,+ &bat->charging_full_trig); led_trigger_register_charging(bat->charging_trig_name, &bat->charging_trig); led_trigger_register_simple(bat->full_trig_name,@@ -243,6 +257,8 @@ full_trig_name_failed: kfree(bat->charging_trig_name); charging_trig_name_failed:+ kfree(bat->charging_full_trig_name);+charging_full_trig_name_failed: #endif power_supplicant_unregister(&bat->pst); power_supplicant_failed:@@ -261,10 +277,12 @@ device_unregister(bat->dev); #ifdef CONFIG_LEDS_TRIGGERS+ led_trigger_unregister_charging(bat->charging_full_trig); led_trigger_unregister_charging(bat->charging_trig); led_trigger_unregister_simple(bat->full_trig); kfree(bat->full_trig_name); kfree(bat->charging_trig_name);+ kfree(bat->charging_full_trig_name); #endif return;