[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241005-power-supply-cleanups-v1-1-45303b2d0a4d@weissschuh.net>
Date: Sat, 05 Oct 2024 12:06:15 +0200
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Sebastian Reichel <sre@...nel.org>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH 1/4] 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@...ssschuh.net>
---
drivers/power/supply/power_supply_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 49534458a9f7d3f6d7c01bd91fa1bb6ed23bc7ad..c4608c60f7de2618941aae6e345a413ee249c0ae 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
--
2.46.2
Powered by blists - more mailing lists