]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dmaengine: stm32: dmamux: clean up route allocation error labels
authorJohan Hovold <johan@kernel.org>
Mon, 17 Nov 2025 16:12:54 +0000 (17:12 +0100)
committerVinod Koul <vkoul@kernel.org>
Sun, 14 Dec 2025 09:17:24 +0000 (14:47 +0530)
Error labels should be named after what they do (and not after wherefrom
they are jumped to).

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://patch.msgid.link/20251117161258.10679-13-johan@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/stm32/stm32-dmamux.c

index 2bd218dbabbb15fdfa0e4212e4382e37a945c5b5..db13498b9c9fe71e37002ea0459949c19bb177c5 100644 (file)
@@ -118,7 +118,7 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
                spin_unlock_irqrestore(&dmamux->lock, flags);
                dev_err(&pdev->dev, "Run out of free DMA requests\n");
                ret = -ENOMEM;
-               goto error_chan_id;
+               goto err_free_mux;
        }
        set_bit(mux->chan_id, dmamux->dma_inuse);
        spin_unlock_irqrestore(&dmamux->lock, flags);
@@ -135,7 +135,7 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
        dma_spec->np = of_parse_phandle(ofdma->of_node, "dma-masters", i - 1);
        if (!dma_spec->np) {
                dev_err(&pdev->dev, "can't get dma master\n");
-               goto error;
+               goto err_clear_inuse;
        }
 
        /* Set dma request */
@@ -167,10 +167,9 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
 
 err_put_dma_spec_np:
        of_node_put(dma_spec->np);
-error:
+err_clear_inuse:
        clear_bit(mux->chan_id, dmamux->dma_inuse);
-
-error_chan_id:
+err_free_mux:
        kfree(mux);
 err_put_pdev:
        put_device(&pdev->dev);