提交 ad40e68b 编写于 作者: A Andrey Borzenkov 提交者: Len Brown

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: NAndrey Borzenkov <arvidjaar@mail.ru>
Acked-by: NAlexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 f194d132
...@@ -125,7 +125,7 @@ static int acpi_battery_technology(struct acpi_battery *battery) ...@@ -125,7 +125,7 @@ static int acpi_battery_technology(struct acpi_battery *battery)
return POWER_SUPPLY_TECHNOLOGY_NiMH; return POWER_SUPPLY_TECHNOLOGY_NiMH;
if (!strcasecmp("LION", battery->type)) if (!strcasecmp("LION", battery->type))
return POWER_SUPPLY_TECHNOLOGY_LION; return POWER_SUPPLY_TECHNOLOGY_LION;
if (!strcasecmp("LI-ION", battery->type)) if (!strncasecmp("LI-ION", battery->type, 6))
return POWER_SUPPLY_TECHNOLOGY_LION; return POWER_SUPPLY_TECHNOLOGY_LION;
if (!strcasecmp("LiP", battery->type)) if (!strcasecmp("LiP", battery->type))
return POWER_SUPPLY_TECHNOLOGY_LIPO; return POWER_SUPPLY_TECHNOLOGY_LIPO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册