Skip to content

Commit bd3ee57

Browse files
t-8chsre
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 34f99d3 commit bd3ee57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/power/supply/power_supply_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static void power_supply_deferred_register_work(struct work_struct *work)
152152
deferred_register_work.work);
153153

154154
if (psy->dev.parent) {
155-
while (!mutex_trylock(&psy->dev.parent->mutex)) {
155+
while (!device_trylock(psy->dev.parent)) {
156156
if (psy->removing)
157157
return;
158158
msleep(10);
@@ -162,7 +162,7 @@ static void power_supply_deferred_register_work(struct work_struct *work)
162162
power_supply_changed(psy);
163163

164164
if (psy->dev.parent)
165-
mutex_unlock(&psy->dev.parent->mutex);
165+
device_unlock(psy->dev.parent);
166166
}
167167

168168
#ifdef CONFIG_OF

0 commit comments

Comments
 (0)