clk: mediatek: apmixed: Drop error message from clk_register() failure
authorChen-Yu Tsai <wenst@chromium.org>
Thu, 19 May 2022 07:16:07 +0000 (15:16 +0800)
committerStephen Boyd <sboyd@kernel.org>
Thu, 19 May 2022 23:57:56 +0000 (16:57 -0700)
mtk_clk_register_ref2usb_tx() prints an error message if clk_register()
fails. It doesn't if kzalloc() fails though. The caller would then tack
on its own error message to handle this.

Also, All other clk registration functions in the MediaTek clk library
leave the error message printing to the bulk registration functions,
while the helpers that register individual clks just return error codes.

Drop the error message that is printed when clk_register() fails in
mtk_clk_register_ref2usb_tx() to make its behavior consistent both
across its failure modes, and with the rest of the driver library.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20220519071610.423372-3-wenst@chromium.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/mediatek/clk-apmixed.c

index a29339cc26c44d200698930ea2732e72603c0c3c..06400c043fe7f434a782bf4b4c0d74e06a86fd7b 100644 (file)
@@ -91,10 +91,8 @@ struct clk * __init mtk_clk_register_ref2usb_tx(const char *name,
 
        clk = clk_register(NULL, &tx->hw);
 
-       if (IS_ERR(clk)) {
-               pr_err("Failed to register clk %s: %pe\n", name, clk);
+       if (IS_ERR(clk))
                kfree(tx);
-       }
 
        return clk;
 }