diff options
author | Nikolaus Voss <n.voss@weinmann.de> | 2012-05-09 02:30:44 -0400 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2012-06-19 22:26:40 -0400 |
commit | 5da50988a1bf8c05611db77521777baaca14da29 (patch) | |
tree | 4e3a7b6396b17afa1ac42e306825f6d2a0ee85c8 /drivers/power/sbs-battery.c | |
parent | ab37813f4093a5f59cb8e083cde277289dc72ed3 (diff) |
sbs-battery: Don't trigger false supply_changed event
power_supply_changed() events are triggerd based on the return value
of a get_property() call. However the property TECHNOLOGY is
hard-coded to LION in this driver, thus always succeeds.
So, with the battery removed, this triggers a false battery present
uevent. This uevent triggers a new query via power_supply_uevent()
which again starts to query all known properties and thus leads to
an infinite loop of battery present/not-present uevents.
This patch skips the battery presence detection for the hard-coded
property TECHNOLOGY.
Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
Acked-by Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power/sbs-battery.c')
-rw-r--r-- | drivers/power/sbs-battery.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/sbs-battery.c b/drivers/power/sbs-battery.c index a5b6849d4123..a65e8f54157e 100644 --- a/drivers/power/sbs-battery.c +++ b/drivers/power/sbs-battery.c | |||
@@ -469,7 +469,7 @@ static int sbs_get_property(struct power_supply *psy, | |||
469 | 469 | ||
470 | case POWER_SUPPLY_PROP_TECHNOLOGY: | 470 | case POWER_SUPPLY_PROP_TECHNOLOGY: |
471 | val->intval = POWER_SUPPLY_TECHNOLOGY_LION; | 471 | val->intval = POWER_SUPPLY_TECHNOLOGY_LION; |
472 | break; | 472 | goto done; /* don't trigger power_supply_changed()! */ |
473 | 473 | ||
474 | case POWER_SUPPLY_PROP_ENERGY_NOW: | 474 | case POWER_SUPPLY_PROP_ENERGY_NOW: |
475 | case POWER_SUPPLY_PROP_ENERGY_FULL: | 475 | case POWER_SUPPLY_PROP_ENERGY_FULL: |