[PATCH 6/7] clk: mediatek: reset: Add support for unregister reset controller

Rex-BC Chen rex-bc.chen at mediatek.com
Mon Apr 18 06:21:53 PDT 2022


Add a function to unregister reset controller.

Signed-off-by: Rex-BC Chen <rex-bc.chen at mediatek.com>
---
 drivers/clk/mediatek/reset.c | 10 ++++++++++
 drivers/clk/mediatek/reset.h |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c
index 709ae54efc18..19f7ac0f8145 100644
--- a/drivers/clk/mediatek/reset.c
+++ b/drivers/clk/mediatek/reset.c
@@ -138,4 +138,14 @@ int mtk_clk_register_rst_ctrl(struct device_node *np,
 	return 0;
 }
 
+int mtk_clk_unregister_rst_ctrl(struct mtk_clk_rst_data *clk_rst)
+{
+	if (!clk_rst)
+		return -EINVAL;
+
+	reset_controller_unregister(&clk_rst->rcdev);
+
+	return 0;
+}
+
 MODULE_LICENSE("GPL");
diff --git a/drivers/clk/mediatek/reset.h b/drivers/clk/mediatek/reset.h
index 851a29c92440..86a785630bb6 100644
--- a/drivers/clk/mediatek/reset.h
+++ b/drivers/clk/mediatek/reset.h
@@ -27,4 +27,6 @@ struct mtk_clk_rst_data {
 int mtk_clk_register_rst_ctrl(struct device_node *np,
 			      struct mtk_clk_rst_data *clk_rst);
 
+int mtk_clk_unregister_rst_ctrl(struct mtk_clk_rst_data *clk_rst);
+
 #endif /* __DRV_CLK_MTK_RESET_H */
-- 
2.18.0




More information about the linux-arm-kernel mailing list