mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 20:46:48 +02:00
power: supply: core: use device mutex wrappers
The mutex is an implementation detail of struct device. Use the dedicated wrappers to access the field. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241005-power-supply-cleanups-v1-1-45303b2d0a4d@weissschuh.net Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
34f99d3b70
commit
bd3ee57b9d
|
|
@ -152,7 +152,7 @@ static void power_supply_deferred_register_work(struct work_struct *work)
|
|||
deferred_register_work.work);
|
||||
|
||||
if (psy->dev.parent) {
|
||||
while (!mutex_trylock(&psy->dev.parent->mutex)) {
|
||||
while (!device_trylock(psy->dev.parent)) {
|
||||
if (psy->removing)
|
||||
return;
|
||||
msleep(10);
|
||||
|
|
@ -162,7 +162,7 @@ static void power_supply_deferred_register_work(struct work_struct *work)
|
|||
power_supply_changed(psy);
|
||||
|
||||
if (psy->dev.parent)
|
||||
mutex_unlock(&psy->dev.parent->mutex);
|
||||
device_unlock(psy->dev.parent);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user