Skip to content

Commit e2ae32d

Browse files
jameszhu-amdalexdeucher
authored andcommitted
drm/amdxcp: fix amdxcp unloads incompletely
amdxcp unloads incompletely, and below error will be seen during load/unload, sysfs: cannot create duplicate filename '/devices/platform/amdgpu_xcp.0' devres_release_group will free xcp device at first, platform device will be unregistered later in platform_device_unregister. Signed-off-by: James Zhu <James.Zhu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent f0b8f65 commit e2ae32d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ EXPORT_SYMBOL(amdgpu_xcp_drm_dev_alloc);
8989
void amdgpu_xcp_drv_release(void)
9090
{
9191
for (--pdev_num; pdev_num >= 0; --pdev_num) {
92-
devres_release_group(&xcp_dev[pdev_num]->pdev->dev, NULL);
93-
platform_device_unregister(xcp_dev[pdev_num]->pdev);
94-
xcp_dev[pdev_num]->pdev = NULL;
92+
struct platform_device *pdev = xcp_dev[pdev_num]->pdev;
93+
94+
devres_release_group(&pdev->dev, NULL);
95+
platform_device_unregister(pdev);
9596
xcp_dev[pdev_num] = NULL;
9697
}
9798
pdev_num = 0;

0 commit comments

Comments
 (0)