ACPI: battery: fix ACPI battery technology reporting
At least some systems report technology information with trailing spaces:
{pts/1}% cat -E /var/tmp/bat/2.6.23 | grep type
battery type: Li-ION $
Use strncasecmp to compare model string to skip trailing part
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
committed by
Len Brown
parent
f194d132e4
commit
ad40e68bf5
@@ -125,7 +125,7 @@ static int acpi_battery_technology(struct acpi_battery *battery)
|
||||
return POWER_SUPPLY_TECHNOLOGY_NiMH;
|
||||
if (!strcasecmp("LION", battery->type))
|
||||
return POWER_SUPPLY_TECHNOLOGY_LION;
|
||||
if (!strcasecmp("LI-ION", battery->type))
|
||||
if (!strncasecmp("LI-ION", battery->type, 6))
|
||||
return POWER_SUPPLY_TECHNOLOGY_LION;
|
||||
if (!strcasecmp("LiP", battery->type))
|
||||
return POWER_SUPPLY_TECHNOLOGY_LIPO;
|
||||
|
||||
Reference in New Issue
Block a user