[PATCH 6.12.y-cip 4/8] memory: renesas-rpc-if: Fix duplicate device name on multi-instance platforms

Lad Prabhakar <[email protected]> Mon, 6 Jul 2026 19:23:24 +0100
Newsgroups org.cip-project.lists.cip-dev
Message-ID <[email protected]>
commit 3fcf9f334d272989b57acc7b94d4eac717206118 upstream.

On platforms with multiple xSPI instances, the driver fails to probe
additional instances due to duplicate sysfs entries:

  [   86.878242] sysfs: cannot create duplicate filename '/bus/platform/devices/rpc-if-spi'

This occurs because platform_device_alloc() uses pdev->id for the device
ID, which may be PLATFORM_DEVID_NONE (-1) for multiple instances, causing
all instances to attempt registration with the same name.

Fix this by using PLATFORM_DEVID_AUTO instead, which automatically assigns
unique IDs to each device instance, allowing multiple xSPI controllers to
coexist without naming conflicts.

Signed-off-by: Lad Prabhakar <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Lad Prabhakar <[email protected]>
---
 drivers/memory/renesas-rpc-if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index 543e03b8aba8..2fd947ba5cce 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -1038,7 +1038,7 @@ static int rpcif_probe(struct platform_device *pdev)
 					     "cannot get enabled spi clk\n");
 	}
 
-	vdev = platform_device_alloc(name, pdev->id);
+	vdev = platform_device_alloc(name, PLATFORM_DEVID_AUTO);
 	if (!vdev)
 		return -ENOMEM;
 	vdev->dev.parent = dev;
-- 
2.43.0