mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
power: supply: core: Remove might_sleep() from power_supply_put()
The put_device() call in power_supply_put() may call
power_supply_dev_release(). The latter function does not sleep so
power_supply_put() doesn't sleep either. Hence, remove the might_sleep()
call from power_supply_put(). This patch suppresses false positive
complaints about calling a sleeping function from atomic context if
power_supply_put() is called from atomic context.
Cc: Kyle Tso <kyletso@google.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Fixes: 1a352462b5 ("power_supply: Add power_supply_put for decrementing device reference counter")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240917193914.47566-1-bvanassche@acm.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
85d319e14f
commit
f6da4553ff
|
|
@ -484,8 +484,6 @@ EXPORT_SYMBOL_GPL(power_supply_get_by_name);
|
|||
*/
|
||||
void power_supply_put(struct power_supply *psy)
|
||||
{
|
||||
might_sleep();
|
||||
|
||||
atomic_dec(&psy->use_cnt);
|
||||
put_device(&psy->dev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user