Commit bd3ee57b authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Sebastian Reichel
Browse files

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: default avatarThomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241005-power-supply-cleanups-v1-1-45303b2d0a4d@weissschuh.net


Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 34f99d3b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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