]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
memory: renesas-rpc-if: Fix duplicate device name on multi-instance platforms
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Fri, 15 May 2026 11:52:02 +0000 (12:52 +0100)
committerKrzysztof Kozlowski <krzk@kernel.org>
Sun, 24 May 2026 19:05:15 +0000 (21:05 +0200)
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 <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://patch.msgid.link/20260515115202.1515577-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
drivers/memory/renesas-rpc-if.c

index 0fb5684561648a6ea079ce44f2544971f7299169..3755956ae90658f6ca3e3a10fd4cfe7c77c5e10b 100644 (file)
@@ -1034,7 +1034,7 @@ static int rpcif_probe(struct platform_device *pdev)
                return dev_err_probe(dev, PTR_ERR(rpc->spi_clk),
                                     "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;