<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>
<style type="text/css">p, li { white-space: pre-wrap; }</style></p>
<div class="moz-cite-prefix">On 2024-04-30 07:36, Lijo Lazar wrote:<br>
</div>
<blockquote type="cite" cite="mid:20240430113620.322882-1-lijo.lazar@amd.com">
<pre class="moz-quote-pre" wrap="">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 'amdxcp' 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 <a class="moz-txt-link-rfc2396E" href="mailto:lijo.lazar@amd.com"><lijo.lazar@amd.com></a></pre>
</blockquote>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Acked-by:<span style=" color:#c0c0c0;"> </span>James<span style=" color:#c0c0c0;"> </span>Zhu<span style=" color:#c0c0c0;"> </span><a class="moz-txt-link-rfc2396E" href="mailto:James.Zhu@amd.com"><James.Zhu@amd.com></a></pre>
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<blockquote type="cite" cite="mid:20240430113620.322882-1-lijo.lazar@amd.com">
<pre class="moz-quote-pre" wrap="">
---
drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c b/drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c
index 90ddd8371176..b4131053b31b 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);
</pre>
</blockquote>
</body>
</html>