mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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: c6e126de43e7 ("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> (cherry picked from commit eeb9a0f79d8e4ea27b4f85a73f3765dc0046ab01) Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
This commit is contained in:
parent
971a6101e8
commit
20b6b7a306
@ -518,7 +518,7 @@ g4fan_exit( void )
|
||||
platform_driver_unregister( &therm_of_driver );
|
||||
|
||||
if( x.of_dev )
|
||||
of_device_unregister( x.of_dev );
|
||||
of_platform_device_destroy(&x.of_dev->dev, NULL);
|
||||
}
|
||||
|
||||
module_init(g4fan_init);
|
||||
|
Loading…
x
Reference in New Issue
Block a user