Skip to content

Commit 89cc135

Browse files
krzkvinodkoul
authored andcommitted
soundwire: amd: simplify return path in hw_params
Remove unused error path (label+goto) to make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent c326356 commit 89cc135

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/soundwire/amd_manager.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,10 +624,8 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
624624

625625
/* Port configuration */
626626
pconfig = kzalloc(sizeof(*pconfig), GFP_KERNEL);
627-
if (!pconfig) {
628-
ret = -ENOMEM;
629-
goto error;
630-
}
627+
if (!pconfig)
628+
return -ENOMEM;
631629

632630
pconfig->num = dai->id;
633631
pconfig->ch_mask = (1 << ch) - 1;
@@ -637,7 +635,7 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
637635
dev_err(amd_manager->dev, "add manager to stream failed:%d\n", ret);
638636

639637
kfree(pconfig);
640-
error:
638+
641639
return ret;
642640
}
643641

0 commit comments

Comments
 (0)