From bd3ee57b9d4c58edbf6f7bba071f6e508c7ff1c6 Mon Sep 17 00:00:00 2001 From: Thomas Weißschuh Date: Sat, 5 Oct 2024 12:06:15 +0200 Subject: power: supply: core: use device mutex wrappers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mutex is an implementation detail of struct device. Use the dedicated wrappers to access the field. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241005-power-supply-cleanups-v1-1-45303b2d0a4d@weissschuh.net Signed-off-by: Sebastian Reichel --- drivers/power/supply/power_supply_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/power') diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 84b77fb49949..e0c87a08bc26 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -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 -- cgit v1.2.3