Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: mediatek: clk-apmixed: Add helper function to unregister ref2usb_tx

The ref2usb_tx clock was introduced a long time ago and, at that time,
the MediaTek clock drivers were using CLK_OF_DECLARE, so they would
never unregister.

Nowadays, unregistering clock drivers is a thing, as we're registering
them as platform_driver and allowing them to be kernel modules: add a
helper function to cleanup the ref2usb_tx clock during error handling
and upon module removal.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20220921091455.41327-8-angelogioacchino.delregno@collabora.com
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

authored by

AngeloGioacchino Del Regno and committed by
Chen-Yu Tsai
b7520e2d 7cbe5cb2

+10
+9
drivers/clk/mediatek/clk-apmixed.c
··· 100 100 } 101 101 EXPORT_SYMBOL_GPL(mtk_clk_register_ref2usb_tx); 102 102 103 + void mtk_clk_unregister_ref2usb_tx(struct clk_hw *hw) 104 + { 105 + struct mtk_ref2usb_tx *tx = to_mtk_ref2usb_tx(hw); 106 + 107 + clk_hw_unregister(hw); 108 + kfree(tx); 109 + } 110 + EXPORT_SYMBOL_GPL(mtk_clk_unregister_ref2usb_tx); 111 + 103 112 MODULE_LICENSE("GPL");
+1
drivers/clk/mediatek/clk-mtk.h
··· 188 188 189 189 struct clk_hw *mtk_clk_register_ref2usb_tx(const char *name, 190 190 const char *parent_name, void __iomem *reg); 191 + void mtk_clk_unregister_ref2usb_tx(struct clk_hw *hw); 191 192 192 193 struct mtk_clk_desc { 193 194 const struct mtk_gate *clks;