File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -868,9 +868,15 @@ static void acpi_battery_remove_fs(struct acpi_device *device)
868
868
static void acpi_battery_notify (struct acpi_device * device , u32 event )
869
869
{
870
870
struct acpi_battery * battery = acpi_driver_data (device );
871
+ #ifdef CONFIG_ACPI_SYSFS_POWER
872
+ struct device * old ;
873
+ #endif
871
874
872
875
if (!battery )
873
876
return ;
877
+ #ifdef CONFIG_ACPI_SYSFS_POWER
878
+ old = battery -> bat .dev ;
879
+ #endif
874
880
acpi_battery_update (battery );
875
881
acpi_bus_generate_proc_event (device , event ,
876
882
acpi_battery_present (battery ));
@@ -879,7 +885,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
879
885
acpi_battery_present (battery ));
880
886
#ifdef CONFIG_ACPI_SYSFS_POWER
881
887
/* acpi_battery_update could remove power_supply object */
882
- if (battery -> bat .dev )
888
+ if (old && battery -> bat .dev )
883
889
power_supply_changed (& battery -> bat );
884
890
#endif
885
891
}
You can’t perform that action at this time.
0 commit comments