Skip to content

Commit 10bf494

Browse files
jhovoldvinodkoul
authored andcommitted
dmaengine: stm32: dmamux: clean up route allocation error labels
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>
1 parent b1b590a commit 10bf494

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/dma/stm32/stm32-dmamux.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
118118
spin_unlock_irqrestore(&dmamux->lock, flags);
119119
dev_err(&pdev->dev, "Run out of free DMA requests\n");
120120
ret = -ENOMEM;
121-
goto error_chan_id;
121+
goto err_free_mux;
122122
}
123123
set_bit(mux->chan_id, dmamux->dma_inuse);
124124
spin_unlock_irqrestore(&dmamux->lock, flags);
@@ -135,7 +135,7 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
135135
dma_spec->np = of_parse_phandle(ofdma->of_node, "dma-masters", i - 1);
136136
if (!dma_spec->np) {
137137
dev_err(&pdev->dev, "can't get dma master\n");
138-
goto error;
138+
goto err_clear_inuse;
139139
}
140140

141141
/* Set dma request */
@@ -167,10 +167,9 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
167167

168168
err_put_dma_spec_np:
169169
of_node_put(dma_spec->np);
170-
error:
170+
err_clear_inuse:
171171
clear_bit(mux->chan_id, dmamux->dma_inuse);
172-
173-
error_chan_id:
172+
err_free_mux:
174173
kfree(mux);
175174
err_put_pdev:
176175
put_device(&pdev->dev);

0 commit comments

Comments
 (0)