Skip to content

Commit bd44ea1

Browse files
nabijaczlewelisre
authored andcommitted
power: supply: apm_power: only unset own apm_get_power_status
Mirroring drivers/macintosh/apm_emu.c, this means that modprobe apm_power && modprobe $anotherdriver && modprobe -r apm_power leaves $anotherdriver's apm_get_power_status instead of deleting it. Fixes: 3788ec9 ("[BATTERY] APM emulation driver for class batteries") Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Link: https://patch.msgid.link/xczpgox57hxbunkcbdl5fxhc4gnsajsipldfidi7355afezk64@tarta.nabijaczleweli.xyz Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 3fd1695 commit bd44ea1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/power/supply/apm_power.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ static int __init apm_battery_init(void)
364364

365365
static void __exit apm_battery_exit(void)
366366
{
367-
apm_get_power_status = NULL;
367+
if (apm_get_power_status == apm_battery_apm_get_power_status)
368+
apm_get_power_status = NULL;
368369
}
369370

370371
module_init(apm_battery_init);

0 commit comments

Comments
 (0)