]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: rcar-vin: Use error labels in probe
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Fri, 13 Jun 2025 15:34:25 +0000 (17:34 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Mon, 16 Jun 2025 06:52:14 +0000 (08:52 +0200)
Prepare for more failed probe conditions that needs cleanup by
converting the error path to use labels.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250613153434.2001800-5-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/renesas/rcar-vin/rcar-core.c

index 73d713868391972e29dae84248fa10d2582c4167..59751ec23a15674cfceafb2e3568503b6f922cec 100644 (file)
@@ -1405,15 +1405,18 @@ static int rcar_vin_probe(struct platform_device *pdev)
                        vin->scaler = vin->info->scaler;
        }
 
-       if (ret) {
-               rvin_dma_unregister(vin);
-               return ret;
-       }
+       if (ret)
+               goto err_dma;
 
        pm_suspend_ignore_children(&pdev->dev, true);
        pm_runtime_enable(&pdev->dev);
 
        return 0;
+
+err_dma:
+       rvin_dma_unregister(vin);
+
+       return ret;
 }
 
 static void rcar_vin_remove(struct platform_device *pdev)