diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2015-03-12 08:44:13 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-03-13 23:15:52 +0100 |
commit | 03e81acce5568c7105dc5bef6984c8b0edfe8d45 (patch) | |
tree | 5a23f5c2245e9d4f170e644e2050638c225b51a1 /lib/ts_fsm.c | |
parent | 1a352462b5377ac68f5955d674b3460c7bac52a3 (diff) | |
download | op-kernel-dev-03e81acce5568c7105dc5bef6984c8b0edfe8d45.zip op-kernel-dev-03e81acce5568c7105dc5bef6984c8b0edfe8d45.tar.gz |
power_supply: Increment power supply use counter when obtaining references
Increment the power_supply.use_cnt usage counter on:
- power_supply_get_by_phandle()
- power_supply_get_by_name()
and decrement it on power_supply_put() call.
This helps tracking of valid usage of power supply instance by
consumers. The usage counter itself also allows safe calling of
power_supply_get_property-like functions even when driver unregisters
this power supply.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'lib/ts_fsm.c')
0 files changed, 0 insertions, 0 deletions