[PATCH 12/12] soc: vt8500: Use devm_soc_device_register() helper

From: Andrew Davis

Date: Wed Nov 11 2026 - 13:05:13 EST


Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <afd@xxxxxx>
---
drivers/soc/vt8500/wmt-socinfo.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/soc/vt8500/wmt-socinfo.c b/drivers/soc/vt8500/wmt-socinfo.c
index e514c98a796fc..49c92e993a45e 100644
--- a/drivers/soc/vt8500/wmt-socinfo.c
+++ b/drivers/soc/vt8500/wmt-socinfo.c
@@ -84,7 +84,7 @@ static int wmt_socinfo_probe(struct platform_device *pdev)
if (!attrs->revision || !attrs->soc_id)
return -ENOMEM;

- soc_dev = soc_device_register(attrs);
+ soc_dev = devm_soc_device_register(&pdev->dev, attrs);
if (IS_ERR(soc_dev))
return PTR_ERR(soc_dev);

@@ -94,17 +94,9 @@ static int wmt_socinfo_probe(struct platform_device *pdev)
attrs->revision,
attrs->soc_id);

- platform_set_drvdata(pdev, soc_dev);
return 0;
}

-static void wmt_socinfo_remove(struct platform_device *pdev)
-{
- struct soc_device *soc_dev = platform_get_drvdata(pdev);
-
- soc_device_unregister(soc_dev);
-}
-
static const struct of_device_id wmt_socinfo_ids[] = {
{ .compatible = "via,vt8500-scc-id" },
{ /* Sentinel */ },
@@ -112,7 +104,6 @@ static const struct of_device_id wmt_socinfo_ids[] = {

static struct platform_driver wmt_socinfo = {
.probe = wmt_socinfo_probe,
- .remove = wmt_socinfo_remove,
.driver = {
.name = "wmt-socinfo",
.of_match_table = wmt_socinfo_ids,
--
2.43.0