linux_dsm_epyc7002/drivers/gpu/drm/etnaviv
Fabio Estevam bf6ba3aeb2 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 246774d17f ("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: <stable@vger.kernel.org>
Fixes: 246774d17f ("drm/etnaviv: remove the need for a gpu-subsystem DT node")
Reported-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2018-06-27 15:26:52 +02:00
..
cmdstream.xml.h drm/etnaviv: Allow DRAW_INSTANCED commands 2016-12-02 19:30:22 +01:00
common.xml.h drm/etnaviv: update hardware headers from rnndb 2018-03-09 12:22:36 +01:00
etnaviv_buffer.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_cmd_parser.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_cmdbuf.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_cmdbuf.h drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_drv.c drm/etnaviv: Fix driver unregistering 2018-06-27 15:26:52 +02:00
etnaviv_drv.h drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_dump.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_dump.h drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_gem_prime.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_gem_submit.c drm/etnaviv: replace hangcheck with scheduler timeout 2018-02-12 16:31:01 +01:00
etnaviv_gem.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_gem.h drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_gpu.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_gpu.h drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_hwdb.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_iommu_v2.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_iommu.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_iommu.h drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_mmu.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_mmu.h drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_perfmon.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_perfmon.h drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_sched.c drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
etnaviv_sched.h drm/etnaviv: replace license text with SPDX tags 2018-05-18 15:27:56 +02:00
Kconfig drm/etnaviv: remove register logging 2018-05-18 15:27:56 +02:00
Makefile drm/etnaviv: add hardware database 2018-03-09 12:22:37 +01:00
state_3d.xml.h drm/etnaviv: update hardware headers from rnndb 2018-03-09 12:22:36 +01:00
state_blt.xml.h drm/etnaviv: update hardware headers from rnndb 2018-03-09 12:22:36 +01:00
state_hi.xml.h drm/etnaviv: update hardware headers from rnndb 2018-03-09 12:22:36 +01:00
state.xml.h drm/etnaviv: update hardware headers from rnndb 2018-03-09 12:22:36 +01:00