diff options
author | Krzysztof Kozlowski <[email protected]> | 2015-03-12 08:44:03 +0100 |
---|---|---|
committer | Sebastian Reichel <[email protected]> | 2015-03-13 23:15:48 +0100 |
commit | bc1540561c9ede1efb6d7bf44804676d3d02a3cc (patch) | |
tree | 9ca0a0051c6a5382e00ec8ced1c56e93378ad9fa /net/lapb/lapb_iface.c | |
parent | 2dc9215d7c94f7f9f34ccf8b1710ad73d82f6216 (diff) |
power_supply: Add API for safe access of power supply function attrs
Add simple wrappers for accessing power supply's function attributes:
- get_property -> power_supply_get_property
- set_property -> power_supply_set_property
- property_is_writeable -> power_supply_property_is_writeable
- external_power_changed -> power_supply_external_power_changed
This API along with atomic usage counter adds a safe way of accessing a
power supply from another driver. If power supply is unregistered after
obtaining reference to it by some driver, then the API wrappers won't be
executed in invalid (freed) context.
Next patch changing the ownership of power supply class is still needed
to fully fix race conditions in accessing freed power supply.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Bartlomiej Zolnierkiewicz <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
Diffstat (limited to 'net/lapb/lapb_iface.c')
0 files changed, 0 insertions, 0 deletions