Skip to content

Commit f6da455

Browse files
bvanasschesre
authored andcommitted
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 <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Fixes: 1a35246 ("power_supply: Add power_supply_put for decrementing device reference counter") Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 85d319e commit f6da455

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/power/supply/power_supply_core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,6 @@ EXPORT_SYMBOL_GPL(power_supply_get_by_name);
484484
*/
485485
void power_supply_put(struct power_supply *psy)
486486
{
487-
might_sleep();
488-
489487
atomic_dec(&psy->use_cnt);
490488
put_device(&psy->dev);
491489
}

0 commit comments

Comments
 (0)