Skip to content

Commit dbb9c37

Browse files
wensmathieupoirier
authored andcommitted
remoteproc: mtk_scp: Only populate devices for SCP cores
When multi-core SCP support was added, the driver was made to populate platform devices for all the sub-nodes. This ended up adding platform devices for the rpmsg sub-nodes as well, which never actually get used, since rpmsg devices are registered through the rpmsg interface. Limit of_platform_populate() to just populating the SCP cores with a compatible string match list. Fixes: 1fdbf0c ("remoteproc: mediatek: Probe SCP cluster on multi-core SCP") Cc: Tinghan Shen <tinghan.shen@mediatek.com> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://lore.kernel.org/r/20241211072009.120511-1-wenst@chromium.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent 1dc7c8e commit dbb9c37

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/remoteproc/mtk_scp.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,11 @@ static int scp_cluster_init(struct platform_device *pdev, struct mtk_scp_of_clus
13261326
return ret;
13271327
}
13281328

1329+
static const struct of_device_id scp_core_match[] = {
1330+
{ .compatible = "mediatek,scp-core" },
1331+
{}
1332+
};
1333+
13291334
static int scp_probe(struct platform_device *pdev)
13301335
{
13311336
struct device *dev = &pdev->dev;
@@ -1357,13 +1362,15 @@ static int scp_probe(struct platform_device *pdev)
13571362
INIT_LIST_HEAD(&scp_cluster->mtk_scp_list);
13581363
mutex_init(&scp_cluster->cluster_lock);
13591364

1360-
ret = devm_of_platform_populate(dev);
1365+
ret = of_platform_populate(dev_of_node(dev), scp_core_match, NULL, dev);
13611366
if (ret)
13621367
return dev_err_probe(dev, ret, "Failed to populate platform devices\n");
13631368

13641369
ret = scp_cluster_init(pdev, scp_cluster);
1365-
if (ret)
1370+
if (ret) {
1371+
of_platform_depopulate(dev);
13661372
return ret;
1373+
}
13671374

13681375
return 0;
13691376
}
@@ -1379,6 +1386,7 @@ static void scp_remove(struct platform_device *pdev)
13791386
rproc_del(scp->rproc);
13801387
scp_free(scp);
13811388
}
1389+
of_platform_depopulate(&pdev->dev);
13821390
mutex_destroy(&scp_cluster->cluster_lock);
13831391
}
13841392

0 commit comments

Comments
 (0)