From: Lijo Lazar Date: Tue, 30 Apr 2024 11:23:16 +0000 (+0530) Subject: drm/amd/amdxcp: Use unique name for partition dev X-Git-Tag: v6.11-rc1~141^2~25^2~463 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97d814fe4f697791abfbe27e035f0b943c483243;p=thirdparty%2Fkernel%2Flinux.git drm/amd/amdxcp: Use unique name for partition dev amdxcp is a platform driver for creating partition devices. libdrm library identifies a platform device based on 'OF_FULLNAME' or 'MODALIAS'. If two or more devices have the same platform name, drm library only picks the first device. Platform driver core uses name of the device to populate 'MODALIAS'. When 'amdgpu_xcp' is used as the base name, only first partition device gets identified. Assign unique name so that drm library identifies partition devices separately. amdxcp doesn't support probe of partitions, it doesn't bother about modaliases. Signed-off-by: Lijo Lazar Acked-by: Alex Deucher Acked-by: Christian König Acked-by: James Zhu Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c b/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c index 90ddd8371176e..b4131053b31b1 100644 --- a/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c +++ b/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c @@ -50,12 +50,14 @@ int amdgpu_xcp_drm_dev_alloc(struct drm_device **ddev) { struct platform_device *pdev; struct xcp_device *pxcp_dev; + char dev_name[20]; int ret; if (pdev_num >= MAX_XCP_PLATFORM_DEVICE) return -ENODEV; - pdev = platform_device_register_simple("amdgpu_xcp", pdev_num, NULL, 0); + snprintf(dev_name, sizeof(dev_name), "amdgpu_xcp_%d", pdev_num); + pdev = platform_device_register_simple(dev_name, -1, NULL, 0); if (IS_ERR(pdev)) return PTR_ERR(pdev);