Skip to content

Commit bf6ba3a

Browse files
Fabio Estevamlynxeye-dev
authored andcommitted
drm/etnaviv: Fix driver unregistering
Russell King reported: "When removing and reloading the etnaviv module, the following splat occurs: sysfs: cannot create duplicate filename '/devices/platform/etnaviv' CPU: 0 PID: 1471 Comm: modprobe Not tainted 4.17.0+ #1608 Hardware name: Marvell Dove (Cubox) Backtrace: [<c00157d4>] (dump_backtrace) from [<c0015b8c>] (show_stack+0x18/0x1c) r6:ef033e38 r5:ee07b340 r4:edb9d000 r3:00000000 [<c0015b74>] (show_stack) from [<c0620784>] (dump_stack+0x20/0x28) [<c0620764>] (dump_stack) from [<c01bcd24>] (sysfs_warn_dup+0x5c/0x70) [<c01bccc8>] (sysfs_warn_dup) from [<c01bce14>] (sysfs_create_dir_ns+0x90/0x98) ..." Commit 246774d ("drm/etnaviv: remove the need for a gpu-subsystem DT node") introduced DRM registration via platform_device_register_simple(), but missed to call platform_device_unregister() inside etnaviv_exit(). Fix the problem by calling platform_device_unregister() inside etnaviv_exit(). While at it, also rearrange the function calls in the exit path to make them happen in the opposite order of registration. Tested on a imx6-sabresd board. Cc: <[email protected]> Fixes: 246774d ("drm/etnaviv: remove the need for a gpu-subsystem DT node") Reported-by: Russell King <[email protected]> Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
1 parent 45a0faa commit bf6ba3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/etnaviv/etnaviv_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,9 @@ module_init(etnaviv_init);
680680

681681
static void __exit etnaviv_exit(void)
682682
{
683-
platform_driver_unregister(&etnaviv_gpu_driver);
683+
platform_device_unregister(etnaviv_drm);
684684
platform_driver_unregister(&etnaviv_platform_driver);
685+
platform_driver_unregister(&etnaviv_gpu_driver);
685686
}
686687
module_exit(etnaviv_exit);
687688

0 commit comments

Comments
 (0)