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:
Thomas Weißschuh 2024-10-05 12:06:15 +02:00 committed by Sebastian Reichel
parent 34f99d3b70
commit bd3ee57b9d

View File

@ -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