[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220519134728.456643-5-y.oudjana@protonmail.com>
Date: Thu, 19 May 2022 17:47:26 +0400
From: Yassine Oudjana <yassine.oudjana@...il.com>
To: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Philipp Zabel <p.zabel@...gutronix.de>
Cc: Yassine Oudjana <y.oudjana@...tonmail.com>,
Chen-Yu Tsai <wenst@...omium.org>,
Miles Chen <miles.chen@...iatek.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Chun-Jie Chen <chun-jie.chen@...iatek.com>,
José Expósito <jose.exposito89@...il.com>,
Rex-BC Chen <rex-bc.chen@...iatek.com>,
Yassine Oudjana <yassine.oudjana@...il.com>,
linux-mediatek@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
~postmarketos/upstreaming@...ts.sr.ht
Subject: [PATCH 4/6] clk: mediatek: reset: Implement mtk_unregister_reset_controller() API
From: Yassine Oudjana <y.oudjana@...tonmail.com>
Add a function to unregister a reset controller previously
registered with mtk_register_reset_controller() or
mtk_register_reset_controller_with_dev(), and do the
necessary cleanup.
Signed-off-by: Yassine Oudjana <y.oudjana@...tonmail.com>
---
Dependencies:
- clk: mediatek: Move to struct clk_hw provider APIs (series)
https://patchwork.kernel.org/project/linux-mediatek/cover/20220510104804.544597-1-wenst@chromium.org/
- Cleanup MediaTek clk reset drivers and support MT8192/MT8195 (series)
https://patchwork.kernel.org/project/linux-mediatek/cover/20220503093856.22250-1-rex-bc.chen@mediatek.com/
- Export required symbols to compile clk drivers as module (single patch)
https://patchwork.kernel.org/project/linux-mediatek/patch/20220518111652.223727-7-angelogioacchino.delregno@collabora.com/
drivers/clk/mediatek/reset.c | 7 +++++++
drivers/clk/mediatek/reset.h | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c
index 09862baf1d57..c1ab8c87ec27 100644
--- a/drivers/clk/mediatek/reset.c
+++ b/drivers/clk/mediatek/reset.c
@@ -232,4 +232,11 @@ struct mtk_clk_rst_data
}
EXPORT_SYMBOL_GPL(mtk_register_reset_controller_with_dev);
+void mtk_unregister_reset_controller(struct mtk_clk_rst_data *data)
+{
+ reset_controller_unregister(&data->rcdev);
+ kfree(data);
+}
+EXPORT_SYMBOL_GPL(mtk_unregister_reset_controller);
+
MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/reset.h b/drivers/clk/mediatek/reset.h
index 7418dd0d046f..0feaea4115a8 100644
--- a/drivers/clk/mediatek/reset.h
+++ b/drivers/clk/mediatek/reset.h
@@ -81,4 +81,10 @@ struct mtk_clk_rst_data
*mtk_register_reset_controller_with_dev(struct device *dev,
const struct mtk_clk_rst_desc *desc);
+/**
+ * mtk_unregister_reset_controller - Unregister mediatek clock reset controller
+ * @data: Pointer to previously registered struct mtk_clk_rst_data.
+ */
+void mtk_unregister_reset_controller(struct mtk_clk_rst_data *data);
+
#endif /* __DRV_CLK_MTK_RESET_H */
--
2.36.1
Powered by blists - more mailing lists