diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2024-02-26 13:10:37 +0100 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2024-02-28 17:13:53 -0800 |
commit | f40056a5b4eb099c05f2748cec2a1023eb86f31a (patch) | |
tree | 5d818a02daef5ecdb58421ad32df142a9ce99d2d | |
parent | 7fcf1ef84f8c5a011f660b496b37b6f456725f96 (diff) | |
download | lwn-f40056a5b4eb099c05f2748cec2a1023eb86f31a.tar.gz lwn-f40056a5b4eb099c05f2748cec2a1023eb86f31a.zip |
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 <elfring@users.sourceforge.net>
Link: https://lore.kernel.org/r/6a64e7b3-b1ce-46c4-9c85-89f731aee592@web.de
Reviewed-by: AngeloGiaocchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
-rw-r--r-- | drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c index 1bbb21ab1786..6cab483b8e1e 100644 --- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c +++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c @@ -152,8 +152,8 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev) clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK); if (IS_ERR_OR_NULL(clk_data)) { - iounmap(base); - return -ENOMEM; + r = -ENOMEM; + goto unmap_io; } fhctl_parse_dt(fhctl_node, pllfhs, ARRAY_SIZE(pllfhs)); @@ -188,6 +188,7 @@ unregister_plls: ARRAY_SIZE(pllfhs), clk_data); free_clk_data: mtk_free_clk_data(clk_data); +unmap_io: iounmap(base); return r; } |