]> Gentwo Git Trees - linux/.git/commitdiff
remoteproc: keystone: Use devm_rproc_add() helper
authorAndrew Davis <afd@ti.com>
Thu, 14 Aug 2025 14:08:35 +0000 (09:08 -0500)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 26 Aug 2025 15:29:37 +0000 (09:29 -0600)
Use the device lifecycle managed add function. This helps prevent mistakes
like deleting out of order in cleanup functions and forgetting to delete
on error paths.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20250814140835.651652-5-afd@ti.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/keystone_remoteproc.c

index 7826853a00fc277e8b7d46acb69e4510d3288706..4d6550b485675a2d41e8f353ec3c607642ac288a 100644 (file)
@@ -455,22 +455,13 @@ static int keystone_rproc_probe(struct platform_device *pdev)
                keystone_rproc_dsp_reset(ksproc);
        }
 
-       ret = rproc_add(rproc);
+       ret = devm_rproc_add(dev, rproc);
        if (ret)
                return dev_err_probe(dev, ret, "failed to register device with remoteproc core\n");
 
-       platform_set_drvdata(pdev, ksproc);
-
        return 0;
 }
 
-static void keystone_rproc_remove(struct platform_device *pdev)
-{
-       struct keystone_rproc *ksproc = platform_get_drvdata(pdev);
-
-       rproc_del(ksproc->rproc);
-}
-
 static const struct of_device_id keystone_rproc_of_match[] = {
        { .compatible = "ti,k2hk-dsp", },
        { .compatible = "ti,k2l-dsp", },
@@ -482,7 +473,6 @@ MODULE_DEVICE_TABLE(of, keystone_rproc_of_match);
 
 static struct platform_driver keystone_rproc_driver = {
        .probe  = keystone_rproc_probe,
-       .remove = keystone_rproc_remove,
        .driver = {
                .name = "keystone-rproc",
                .of_match_table = keystone_rproc_of_match,