WSL2-Linux-Kernel/drivers/macintosh
Nick Bowler dc00026b89 macintosh/therm_windtunnel: fix module unload.
[ Upstream commit fd748e177194ebcbbaf98df75152a30e08230cc6 ]

The of_device_unregister call in therm_windtunnel's module_exit procedure
does not fully reverse the effects of of_platform_device_create in the
module_init prodedure.  Once you unload this module, it is impossible
to load it ever again since only the first of_platform_device_create
call on the fan node succeeds.

This driver predates first git commit, and it turns out back then
of_platform_device_create worked differently than it does today.
So this is actually an old regression.

The appropriate function to undo of_platform_device_create now appears
to be of_platform_device_destroy, and switching to use this makes it
possible to unload and load the module as expected.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Fixes: c6e126de43 ("of: Keep track of populated platform devices")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240711035428.16696-1-nbowler@draconx.ca
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-19 05:45:06 +02:00
..
ams
Kconfig macintosh: via-pmu-led: requires ATA to be set 2023-05-11 23:00:34 +09:00
Makefile
adb-iop.c
adb.c macintosh/adb: fix oob read in do_adb_query() function 2022-08-11 13:07:54 +02:00
adbhid.c
ans-lcd.c
ans-lcd.h
apm_emu.c
mac_hid.c
macio-adb.c macintosh/macio-adb: check the return value of ioremap() 2022-12-31 13:14:35 +01:00
macio_asic.c macintosh: fix possible memory leak in macio_add_one_device() 2022-12-31 13:14:35 +01:00
macio_sysfs.c
mediabay.c
rack-meter.c
smu.c
therm_adt746x.c
therm_windtunnel.c macintosh/therm_windtunnel: fix module unload. 2024-08-19 05:45:06 +02:00
via-cuda.c
via-macii.c macintosh/via-macii: Fix "BUG: sleeping function called from invalid context" 2024-06-16 13:39:23 +02:00
via-pmu-backlight.c
via-pmu-event.c
via-pmu-event.h
via-pmu-led.c
via-pmu.c
windfarm.h
windfarm_ad7417_sensor.c
windfarm_core.c
windfarm_cpufreq_clamp.c
windfarm_fcu_controls.c
windfarm_lm75_sensor.c macintosh: windfarm: Use unsigned type for 1-bit bitfields 2023-03-17 08:49:01 +01:00
windfarm_lm87_sensor.c
windfarm_max6690_sensor.c
windfarm_mpu.h
windfarm_pid.c
windfarm_pid.h
windfarm_pm72.c
windfarm_pm81.c
windfarm_pm91.c
windfarm_pm112.c
windfarm_pm121.c
windfarm_rm31.c
windfarm_smu_controls.c
windfarm_smu_sat.c macintosh/windfarm_smu_sat: Add missing of_node_put() 2023-05-11 23:00:34 +09:00
windfarm_smu_sensors.c macintosh: windfarm: Use unsigned type for 1-bit bitfields 2023-03-17 08:49:01 +01:00