Skip to content

Commit f40056a

Browse files
elfringbebarino
authored andcommitted
clk: mediatek: clk-mt8173-apmixedsys: Use common error handling code in clk_mt8173_apmixed_probe()
Add a label so that a bit of exception handling can be better reused at the end of this function implementation. Signed-off-by: Markus Elfring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: AngeloGiaocchino Del Regno <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 7fcf1ef commit f40056a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/clk/mediatek/clk-mt8173-apmixedsys.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
152152

153153
clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
154154
if (IS_ERR_OR_NULL(clk_data)) {
155-
iounmap(base);
156-
return -ENOMEM;
155+
r = -ENOMEM;
156+
goto unmap_io;
157157
}
158158

159159
fhctl_parse_dt(fhctl_node, pllfhs, ARRAY_SIZE(pllfhs));
@@ -188,6 +188,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
188188
ARRAY_SIZE(pllfhs), clk_data);
189189
free_clk_data:
190190
mtk_free_clk_data(clk_data);
191+
unmap_io:
191192
iounmap(base);
192193
return r;
193194
}

0 commit comments

Comments
 (0)