Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1010700iob; Wed, 4 May 2022 12:38:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDCRa0u6zHICa1j63tlr73rVDAb1r97pUwJqD6lasHuDh/y/vDSYESS5xpSQIgH1/Kb4GW X-Received: by 2002:a63:8ac7:0:b0:3aa:f853:4f62 with SMTP id y190-20020a638ac7000000b003aaf8534f62mr19296910pgd.205.1651693113390; Wed, 04 May 2022 12:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651693113; cv=none; d=google.com; s=arc-20160816; b=tWJ0QM659SUbmkxBscfJ14uxMJ/wSH6HrQlzCR6gNLaJNV3Zbv0w3auVm2XUf3f8Wk atNeswe6KdYUDWgKeqeqL8WKARBJYIYPGOMc4EtrKyfSWC43HfpU/N/Qf+SU6H4siy0S 3DcuDMsQC53iAek53qK0OLh4d3Jy8VmpVwCMaOUaU6TS8qG/97Y2ttTUCS0Ap+l0QHxN 0gmNEWLaV13+WIP2+KxZWGCmxo0g8/rwKLYyxH5HEh3oq6F2JlRY/cVyMsIA86fwpPOI BxOwk7K5OgpOgBv9Wr54YkxzbeTyj5VIbS9Qm0ZEnWWSLD5I4mdWQbl+PX84z9t4UUza wteA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bqWHfh4DenBhYZWygCRQbAilVjZPwr6A8uSbGQA4n4g=; b=pPXzLpgii25tsDSq9kKRhv/OXCjCz8uy5QLzezkrLdu0oDV8zo9CYvz2xSgb6bPi8w c87uE7cIrP6j9TxioBH3JqRhlC+Noq9VHFPdR2BBWDleFO0mGks2S2hoYnwDH34hmt6W RdwG6y8Stol2Eu69g075MOrVkP3u3zcDXzDQi0I9d0WHE9hH0VtQ5/DPif1NYGWCfmxJ CWvVwWqS32crE12hwDs8mHyKB3cJXgY8XRLM8z6hvlrPfZewShVsdURgg/0C3B3RzwMY ae1lKZB/Ew1YZt5NTTtxxAgCGYpgBz7rwpD2/7rIBQl7Dbq4c6l3LPXPMybfgNskRowh MlIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EZzaLJio; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a6566d4000000b003ab49d83284si22271227pgw.476.2022.05.04.12.38.16; Wed, 04 May 2022 12:38:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EZzaLJio; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349747AbiEDMhG (ORCPT + 99 others); Wed, 4 May 2022 08:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349723AbiEDMgr (ORCPT ); Wed, 4 May 2022 08:36:47 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA5A3340C9; Wed, 4 May 2022 05:33:10 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id kq17so2601715ejb.4; Wed, 04 May 2022 05:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bqWHfh4DenBhYZWygCRQbAilVjZPwr6A8uSbGQA4n4g=; b=EZzaLJio+J3mjbbdhdVzx9o+zyM0yUBmXhCHYMUe6sKGiZiRW+p2IPAa4xWiey50Yj CZA/rkUSAR3XnRJmilJxvBcro6ohrkcqM5V31qy35yeG1jUaNWkfH3OZEzB5aE22Fqvm qK0drlQdJC5dK0OpNtbGrjEnX+WD/M1fLvHKcgQ32xvorx4antbKnPiXByg/y2fZhJwg StOIjjopQ9QfPL0WfTtMkA/lnTHUSomeZcwtAvqr3gLaEWjwG/BRJQWAQEjCE4/V1kEm KmK5I/BRyRr0KEATiU6yNSY1N+AP74b1yWLPzlnzdEQ4WuvPb+IHNojcmh49oGarhL+F r6Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bqWHfh4DenBhYZWygCRQbAilVjZPwr6A8uSbGQA4n4g=; b=8BovGrIJYdrHifARh9rd1e7L5WBE8DUDkIHQuvs97ZfLOsMAO4CIMKNkoJxy4TkNwu PCI8ND0kTyWzTR5FlXMmJDGaDy8L2/b8THbydCz+1faE/vqR+cy2ou69B1Ulllzf3Kdf 1p8IesUDnmqoOEm7bfkIgls4VZGqUlZp93MPUmpe7b4ErV8hFpuPYxqO39Ag4Gk8CmWZ vUZfWEHcfIxcuEtXPHvLUQE719G8e2qjH3SapNmzt8M+myuekOAMQPKEyatszGHIcH2d /reQ9V7vnkVGKqZ1PkF5/wJODmQg/hRhNeTV2X1/4Yx0OdxzYJ9bVXRk4BuefnEKTE6Q wnsg== X-Gm-Message-State: AOAM530GT0wh/7x+DZA6/RvJPBhVSCuKVXa7EkFPO0FNnJ4hWwFkbYEH DeAqPSDLM6qKIAVBsg7oB/A= X-Received: by 2002:a17:906:2ac9:b0:6ce:dc0f:9139 with SMTP id m9-20020a1709062ac900b006cedc0f9139mr19979129eje.206.1651667589400; Wed, 04 May 2022 05:33:09 -0700 (PDT) Received: from localhost.localdomain (185-177-124-12.hosted-by-worldstream.net. [185.177.124.12]) by smtp.gmail.com with ESMTPSA id ig1-20020a1709072e0100b006f3ef214e7asm5688693ejc.224.2022.05.04.05.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 05:33:09 -0700 (PDT) From: Yassine Oudjana X-Google-Original-From: Yassine Oudjana To: Matthias Brugger , Stephen Boyd , Michael Turquette , Philipp Zabel , Rob Herring , Krzysztof Kozlowski Cc: Yassine Oudjana , Yassine Oudjana , Chun-Jie Chen , Chen-Yu Tsai , Tinghan Shen , AngeloGioacchino Del Regno , Weiyi Lu , Ikjoon Jang , Miles Chen , Sam Shih , Bartosz Golaszewski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 11/13] clk: mediatek: reset: Implement mtk_unregister_reset_controller() API Date: Wed, 4 May 2022 16:26:00 +0400 Message-Id: <20220504122601.335495-12-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504122601.335495-1-y.oudjana@protonmail.com> References: <20220504122601.335495-1-y.oudjana@protonmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yassine Oudjana Add a function to unregister a reset controller previously registered with mtk_register_reset_controller() or mtk_register_reset_controller_set_clr(), and do the necessary cleanup. Signed-off-by: Yassine Oudjana --- drivers/clk/mediatek/clk-mtk.h | 2 ++ drivers/clk/mediatek/reset.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h index 317905ec4a36..1a0462d9c20b 100644 --- a/drivers/clk/mediatek/clk-mtk.h +++ b/drivers/clk/mediatek/clk-mtk.h @@ -196,6 +196,8 @@ struct mtk_reset *mtk_register_reset_controller(struct device_node *np, struct mtk_reset *mtk_register_reset_controller_set_clr(struct device_node *np, unsigned int num_regs, int regofs); +void mtk_unregister_reset_controller(struct mtk_reset *data); + struct mtk_clk_desc { const struct mtk_gate *clks; size_t num_clks; diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c index f853bc8a7092..7201e1f5e07b 100644 --- a/drivers/clk/mediatek/reset.c +++ b/drivers/clk/mediatek/reset.c @@ -141,4 +141,11 @@ struct mtk_reset *mtk_register_reset_controller_set_clr(struct device_node *np, } EXPORT_SYMBOL_GPL(mtk_register_reset_controller_set_clr); +void mtk_unregister_reset_controller(struct mtk_reset *data) +{ + reset_controller_unregister(&data->rcdev); + kfree(data); +} +EXPORT_SYMBOL_GPL(mtk_unregister_reset_controller); + MODULE_LICENSE("GPL"); -- 2.36.0