aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorAndrey Borzenkov <arvidjaar@mail.ru>2007-11-10 12:02:49 -0500
committerLen Brown <len.brown@intel.com>2007-12-06 22:29:22 -0500
commitad40e68bf5c54831cd6b2199fd24d616bac179f7 (patch)
tree9d2fd20462e854f74df4b8cb2d30651383942ed4 /drivers/acpi
parentf194d132e4971111f85c18c96067acffb13cee6d (diff)
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 7d6be23eff89..8f7505d304b5 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -125,7 +125,7 @@ static int acpi_battery_technology(struct acpi_battery *battery)
125 return POWER_SUPPLY_TECHNOLOGY_NiMH; 125 return POWER_SUPPLY_TECHNOLOGY_NiMH;
126 if (!strcasecmp("LION", battery->type)) 126 if (!strcasecmp("LION", battery->type))
127 return POWER_SUPPLY_TECHNOLOGY_LION; 127 return POWER_SUPPLY_TECHNOLOGY_LION;
128 if (!strcasecmp("LI-ION", battery->type)) 128 if (!strncasecmp("LI-ION", battery->type, 6))
129 return POWER_SUPPLY_TECHNOLOGY_LION; 129 return POWER_SUPPLY_TECHNOLOGY_LION;
130 if (!strcasecmp("LiP", battery->type)) 130 if (!strcasecmp("LiP", battery->type))
131 return POWER_SUPPLY_TECHNOLOGY_LIPO; 131 return POWER_SUPPLY_TECHNOLOGY_LIPO;