Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thomas Weißschuh and committed by
Sebastian Reichel
bd3ee57b 34f99d3b

+2 -2
+2 -2
drivers/power/supply/power_supply_core.c
··· 152 152 deferred_register_work.work); 153 153 154 154 if (psy->dev.parent) { 155 - while (!mutex_trylock(&psy->dev.parent->mutex)) { 155 + while (!device_trylock(psy->dev.parent)) { 156 156 if (psy->removing) 157 157 return; 158 158 msleep(10); ··· 162 162 power_supply_changed(psy); 163 163 164 164 if (psy->dev.parent) 165 - mutex_unlock(&psy->dev.parent->mutex); 165 + device_unlock(psy->dev.parent); 166 166 } 167 167 168 168 #ifdef CONFIG_OF