forked from mirrors/linux
		
	Newly inserted battery might differ from one just removed, so
update of battery info fields is required. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Acked-by: Andy Neitzke <neitzke@ias.edu> Signed-off-by: Alexey Starikovskiy <astarikovskiy <at> suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
		
							parent
							
								
									3d44cc3e01
								
							
						
					
					
						commit
						50b178512b
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -471,7 +471,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery) | ||||||
| 
 | 
 | ||||||
| static int acpi_battery_update(struct acpi_battery *battery) | static int acpi_battery_update(struct acpi_battery *battery) | ||||||
| { | { | ||||||
| 	int result; | 	int result, old_present = acpi_battery_present(battery); | ||||||
| 	result = acpi_battery_get_status(battery); | 	result = acpi_battery_get_status(battery); | ||||||
| 	if (result) | 	if (result) | ||||||
| 		return result; | 		return result; | ||||||
|  | @ -482,7 +482,8 @@ static int acpi_battery_update(struct acpi_battery *battery) | ||||||
| 		return 0; | 		return 0; | ||||||
| 	} | 	} | ||||||
| #endif | #endif | ||||||
| 	if (!battery->update_time) { | 	if (!battery->update_time || | ||||||
|  | 	    old_present != acpi_battery_present(battery)) { | ||||||
| 		result = acpi_battery_get_info(battery); | 		result = acpi_battery_get_info(battery); | ||||||
| 		if (result) | 		if (result) | ||||||
| 			return result; | 			return result; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Alexey Starikovskiy
						Alexey Starikovskiy